BI Report - RTF Template - Generate dynamic columns

RTF Template:

<?horizontal-break-table:1?>

Rows

<?for-each-group@section:G_1;CMP?>
<?sort:current-group()/NAME;'ascending';data-type='text'?>
<?variable@incontext:LE;CMP?>

Columns

<?for-each-group@column: G_1;RPT_PERIOD?>
<?sort:current-group()/RPT_PERIOD;'ascending';data-type='number'?>

Cell
<?for-each-group@cell: G_1;CNT?>
<?sort:current-group()/RPT_PERIOD;'ascending';data-type='number'?>

Cell-Value
<?if:count(current-group()[CMP=$LE])?>
<?sum(current-group()[CMP=$LE]/CNT)?>
<?end if?>


Sample Data Model Output:


<?xml version = '1.0' encoding = 'utf-8'?>
<DATA_DS>
<ASOFDATE>2021-04-23T00:00:00.000+00:00</ASOFDATE>
<G_1>
<CMP>NYC</CMP>
<CNT>5322</CNT>
<NAME>NYC, LLC</NAME>
<RPT_PERIOD>1</RPT_PERIOD>
<RPT_DATE>2021-04-23T20:08:28.000+00:00</RPT_DATE>
</G_1>
<G_1>
<CMP>NYC</CMP>
<CNT>322</CNT>
<NAME>NYC, LLC</NAME>
<RPT_PERIOD>2</RPT_PERIOD>
<RPT_DATE>2021-02-23T20:08:28.000+00:00</RPT_DATE>
</G_1>
<G_1>
<CMP>SFO</CMP>
<CNT>657</CNT>
<NAME>SFO, LLC</NAME>
<RPT_PERIOD>1</RPT_PERIOD>
<RPT_DATE>2021-04-23T20:08:28.000+00:00</RPT_DATE>
</G_1>
<G_1>
<CMP>SFO</CMP>
<CNT>1</CNT>
<NAME>SFO, LLC</NAME>
<RPT_PERIOD>2</RPT_PERIOD>
<RPT_DATE>2021-04-23T20:08:28.000+00:00</RPT_DATE>
</G_1>
<G_1>
<CMP>ORD</CMP>
<CNT>518</CNT>
<NAME>ORD, Inc.</NAME>
<RPT_PERIOD>1</RPT_PERIOD>
<RPT_DATE>2021-04-23T20:08:28.000+00:00</RPT_DATE>
</G_1>
</DATA_DS>

No comments:

Post a Comment

Oracle HCM Cloud technical tips to grow your skills

Few information around Oracle HCM Cloud.