Revaluation Report
Revalues foreign-currency general-ledger balances to a period-end rate and books the unrealized gain or loss — by account and currency, with the revaluation journal it produces.
Related The journal-producing revaluation run; the Unrealized Foreign Currency Revaluation Report shows the full period-end picture.
Run note · BIP run High-volume GL extracts can exceed BI Publisher's online output limit and time out. Run it as a scheduled process (ESS) with output bursted to file or email rather than online preview, and bound it by ledger and period.
Sample build of the Revaluation Report — reconciled, and rendered tool-neutral so it runs in Power BI, ThoughtSpot, or Tableau.
| Account | Currency | Entered Balance | Reval Rate | Revalued Balance | Unrealized G/l |
|---|---|---|---|---|---|
| 1000-2100-000 | USD | $1,240,500.00 | Sample | $1,240,500.00 | Sample |
| 1000-5400-000 | USD | $842,150.75 | — | $842,150.75 | — |
| 1000-1410-000 | USD | $96,400.00 | Sample | $96,400.00 | Sample |
| 2000-2100-000 | USD | $1,005,233.10 | — | $1,005,233.10 | — |
| 1000-6300-000 | USD | $58,720.40 | Sample | $58,720.40 | Sample |
| 1000-2100-000 | USD | $1,240,500.00 | Sample | $1,240,500.00 | Sample |
The report reads GL_BALANCES against the period-end rate and posts the unrealized gain or loss journal.
One currency's balances were revalued on a stale rate — its rate date precedes the period end, understating the unrealized movement.
Load the period-end rate for that currency and re-run; revaluing on a stale rate is the usual cause of an FX gain or loss that looks too small.
This is the report's BI Publisher data model — the SQL data set BI Publisher runs against Oracle tables to produce the output. The same SQL becomes a dbt model in your warehouse, so one definition drives both the formatted report and the analytics layer.
Data sources
Show / hide SQL
WITH REVAL_ACC AS
(
SELECT DISTINCT
GJL1.je_header_id
, GCC1.segment1
, GCC1.segment7
FROM
gl_je_headers GJH1 JOIN gl_je_lines GJL1 ON GJH1.je_header_id= GJL1.je_header_id
AND UPPER(GJH1.je_source)='REVALUATION'
JOIN gl_code_combinations GCC1 ON GJL1.code_combination_id=GCC1.code_combination_id
AND GCC1.segment5 ='NNNN'
JOIN fnd_lookup_values FLV ON GCC1.segment4=FLV.lookup_code
AND FLV.lookup_type ='XXC_REVALUATION_ACCOUNTS'
AND FLV.language =USERENV('LANG')
)
, BEG_BAL AS
(
SELECT DISTINCT
GCC.segment4
, SUM(GB.begin_balance_dr-GB.begin_balance_cr) BEG_BAL
FROM
gl_balances GB JOIN gl_code_combinations GCC ON GB.code_combination_id=GCC.code_combination_id
AND GCC.segment5 ='NNNN'
JOIN fnd_lookup_values FLV ON GCC.segment4=FLV.lookup_code
AND FLV.lookup_type ='XXC_REVALUATION_ACCOUNTS'
AND FLV.language =USERENV('LANG')
WHERE
(GB.period_name IN (:P_PERIOD) OR 'All' IN (:P_PERIOD||'All'))
GROUP BY
GCC.segment4
HAVING SUM(GB.begin_balance_dr-GB.begin_balance_cr)>0
)
, OTH_SRC AS
(
SELECT DISTINCT
GJL2.je_header_id
FROM
gl_je_headers GJH2 JOIN gl_je_lines GJL2 ON GJH2.je_header_id= GJL2.je_header_id
AND UPPER(GJH2.je_source) IN ('MANUAL','SPREADSHEET','AUTOCOPY')
JOIN gl_code_combinations GCC2 ON GJL2.code_combination_id=GCC2.code_combination_id
/*JOIN fnd_lookup_values FLV ON GCC2.segment4=FLV.lookup_code
AND FLV.lookup_type ='XXC_REVALUATION_ACCOUNTS'
AND FLV.language =USERENV('LANG')*/
JOIN BEG_BAL BB ON GCC2.segment4=BB.segment4
JOIN reval_acc RA ON GCC2.segment1=RA.segment1
AND GCC2.segment7=RA.segment7
)
SELECT
BATCH_NAME
, JE_HEADER_ID
, JOURNAL_NAME
, LEDGER
, PERIOD_NAME
, START_DATE
, DEFAULT_EFFECTIVE_DATE
, LE
, ACC_CC
, DESCRIPTION
, CURRENCY_CODE
, ENTERED_DR
, ENTERED_CR
, ACC_CUR
, ACCOUNTED_DR
, ACCOUNTED_CR
, CURRENCY_CONVERSION_RATE
, MON_END_RATE
, JE_LINE_NUM
, USER_JE_SOURCE_NAME
, USER_JE_CATEGORY_NAME
, SORT
FROM
(
SELECT
GJB.name BATCH_NAME
, GJH.je_header_id
, GJH.name JOURNAL_NAME
, GL.name LEDGER
, TO_CHAR(GLP.start_date,'Mon-YY','nls_date_language=American') PERIOD_NAME
, GLP.start_date
, GJH.default_effective_date
, GJL.je_line_num
, GCC.segment1 LE
, fnd_flex_ext.get_segs('GL','GL#',GCC.chart_of_accounts_id,GCC.code_combination_id) ACC_CC
, GJL.description
, GJH.currency_code
, GJL.entered_dr
, GJL.entered_cr
, GL.currency_code ACC_CUR
, GJL.accounted_dr
, GJL.accounted_cr
, GJL.currency_conversion_rate
, (
SELECT
GDR.conversion_rate
FROM
gl_daily_rates GDR
, gl_daily_conversion_types GCT
WHERE
UPPER(GCT.user_conversion_type) ='PERIOD END'
AND GCT.conversion_type =GDR.conversion_type
AND GDR.from_currency =GJH.currency_code
AND GDR.to_currency =GL.currency_code
AND TRUNC(GDR.CONVERSION_DATE) =LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE),-1))
) MON_END_RATE
, GJS.user_je_source_name
, GJC.user_je_category_name
, 1 SORT
FROM
gl_je_batches GJB JOIN gl_je_headers GJH ON GJB.je_batch_id= GJH.je_batch_id
JOIN gl_ledgers GL ON GJH.ledger_id=GL.ledger_id
JOIN gl_periods GLP ON GLP.period_name=GJB.default_period_name
AND GLP.period_type=GL.accounted_period_type
JOIN gl_je_lines GJL ON GJH.je_header_id=GJL.je_header_id
JOIN gl_code_combinations GCC ON GJL.code_combination_id=GCC.code_combination_id
JOIN gl_je_sources GJS ON GJH.je_source=GJS.je_source_name
JOIN gl_je_categories GJC ON GJH.je_category=GJC.je_category_name
WHERE
1 =1
AND UPPER(GJS.user_je_source_name) ='REVALUATION'
AND (GL.NAME IN (SELECT DISTINCT GL.NAME
FROM
gl_ledger_set_assignments GLSA,
gl_ledgers GLS
WHERE
GLSA.ledger_set_id =GLS.ledger_id
AND GL.ledger_id =GLSA.ledger_id
AND UPPER(GL.LEDGER_CATEGORY_CODE) <> 'NONE'
AND (GLS.name IN (:P_LEDGER)
OR 'All' IN (:P_LEDGER||'All'))) OR GL.NAME IN (:P_LEDGER) OR 'All' IN (:P_LEDGER||'All'))
AND GLP.start_date <= (select distinct start_date from gl_periods where period_set_name = GLP.period_set_name and period_name = :P_PERIOD AND adjustment_period_flag ='N')
AND (GCC.segment1 IN (:P_LE) OR 'All' IN (:P_LE||'All'))
/*AND ((SELECT F.DESCRIPTION FROM fnd_flex_values_vl F
WHERE 1=1
AND GCC.segment1 =F.flex_value
AND F.value_category ='ENTITY VALUE SET'
AND F.enabled_flag ='Y') IN (:P_LE_NAME) OR 'All' IN (:P_LE_NAME||'All'))*/
AND EXISTS (
SELECT DISTINCT
GJL1.je_header_id
FROM
gl_je_lines GJL1 JOIN gl_code_combinations GCC1 ON GJL1.code_combination_id=GCC1.code_combination_id
AND GJH.je_header_id=GJL1.je_header_id
AND GCC1.segment5 ='NNNN'
JOIN fnd_lookup_values FLV ON GCC1.segment4=FLV.lookup_code
AND FLV.lookup_type ='XXC_REVALUATION_ACCOUNTS'
AND FLV.language =USERENV('LANG')
)
UNION
SELECT
GJB.name BATCH_NAME
, GJH.je_header_id
, GJH.name JOURNAL_NAME
, GL.name LEDGER
, TO_CHAR(GLP.start_date,'Mon-YY','nls_date_language=American') PERIOD_NAME
, GLP.start_date
, GJH.default_effective_date
, GJL.je_line_num
, GCC.segment1 LE
, fnd_flex_ext.get_segs('GL','GL#',GCC.chart_of_accounts_id,GCC.code_combination_id) ACC_CC
, GJL.description
, GJH.currency_code
, GJL.entered_dr
, GJL.entered_cr
, GL.currency_code ACC_CUR
, GJL.accounted_dr
, GJL.accounted_cr
, GJL.currency_conversion_rate
, (
SELECT
GDR.conversion_rate
FROM
gl_daily_rates GDR
, gl_daily_conversion_types GCT
WHERE
UPPER(GCT.user_conversion_type) ='PERIOD END'
AND GCT.conversion_type =GDR.conversion_type
AND GDR.from_currency =GJH.currency_code
AND GDR.to_currency =GL.currency_code
AND TRUNC(GDR.CONVERSION_DATE) =LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE),-1))
) MON_END_RATE
, GJS.user_je_source_name
, GJC.user_je_category_name
, 2 SORT
FROM
gl_je_batches GJB JOIN gl_je_headers GJH ON GJB.je_batch_id= GJH.je_batch_id
JOIN gl_ledgers GL ON GJH.ledger_id=GL.ledger_id
JOIN gl_periods GLP ON GLP.period_name=GJB.default_period_name
AND GLP.period_type=GL.accounted_period_type
JOIN gl_je_lines GJL ON GJH.je_header_id=GJL.je_header_id
JOIN gl_code_combinations GCC ON GJL.code_combination_id=GCC.code_combination_id
JOIN gl_je_sources GJS ON GJH.je_source=GJS.je_source_name
JOIN gl_je_categories GJC ON GJH.je_category=GJC.je_category_name
JOIN oth_src OS ON GJH.je_header_id=OS.je_header_id
WHERE
1 =1
AND UPPER(GJS.user_je_source_name) IN ('MANUAL','SPREADSHEET','AUTOCOPY')
AND (GL.NAME IN (SELECT DISTINCT GL.NAME
FROM
gl_ledger_set_assignments GLSA,
gl_ledgers GLS
WHERE
GLSA.ledger_set_id =GLS.ledger_id
AND GL.ledger_id =GLSA.ledger_id
AND UPPER(GL.LEDGER_CATEGORY_CODE) <> 'NONE'
AND (GLS.name IN (:P_LEDGER)
OR 'All' IN (:P_LEDGER||'All'))) OR GL.NAME IN (:P_LEDGER) OR 'All' IN (:P_LEDGER||'All'))
AND GLP.start_date <= (select distinct start_date from gl_periods where period_set_name = GLP.period_set_name and period_name = :P_PERIOD AND adjustment_period_flag ='N')
AND (GCC.segment1 IN (:P_LE) OR 'All' IN (:P_LE||'All'))
)
WHERE
1 =1
ORDER BY
SORT
, LEDGER
, LE
, PERIOD_NAME DESC
, JE_HEADER_ID
, JE_LINE_NUMThe data-warehouse model — one fact surrounded by conformed dimensions (what you slice by) and measures (what you aggregate), expressed as dbt so it migrates with you. Grain: one row per source transaction.
| Element | Type | Definition |
|---|---|---|
| GL_JE_LINES | dimension | dimension |
| GL_CODE_COMBINATIONS | dimension | dimension |
| GL_BALANCES | dimension | dimension |
| GL_DAILY_RATES | dimension | dimension |
| Entered Balance | measure | measure |
| Revalued Balance | measure | measure |
Every source object behind this report. Each linked table has its own page with full column descriptions, drawn from the Oracle BICC lineage and articulated for practitioners.
| Table | Reporting columns | Subject areas |
|---|---|---|
| GL_JE_HEADERS | 34 | 2 |
| GL_JE_LINES | 26 | 2 |
| GL_CODE_COMBINATIONS | 7 | 61 |
| GL_BALANCES | Setup / configuration table — joined for reference, not exposed for analytics | |
| GL_DAILY_RATES | 1 | 10 |