XML OUTPUT Stage - Trigger Column for Grouping
Posted: Fri Mar 18, 2011 3:15 am
I am generating an XML file. The requirement is when Prdname and ccy col changes we need to have <accounts> tag opened and closed for new combination. So in order to achieve this if I am giving the trigger column as prdname, then i am getting the following output:
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>CR ACCOUNT-SPC</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
</datarow>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>TEST PRODUCT NAME</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
</datarow>
</accounts>
There is only option of selecting only one column as Trigger column in XmlOutput stage. So i created a dummy column and contanenated prd_name and ccy columns and used this dummy column as trigger columns. Now the tags and output format is coming as expected. But the dummy column data is also being traversed to the output xm file.
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>CR ACCOUNT-SPC</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
<dummy>CR ACCOUNT-SPC~IDR</dummy>
</datarow>
</accounts>
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>TEST PRODUCT NAME</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
<dummy>TEST PRODUCT NAME~IDR</dummy>
</datarow>
</accounts>
So now in the above xml the tags - dummy tag needs to be removed as it was used for grouping.
Expected output :
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>CR ACCOUNT-SPC</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
</datarow>
</accounts>
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>TEST PRODUCT NAME</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
</datarow>
</accounts>
Please can you let me know what needs to be done to achieve the desired output.
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>CR ACCOUNT-SPC</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
</datarow>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>TEST PRODUCT NAME</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
</datarow>
</accounts>
There is only option of selecting only one column as Trigger column in XmlOutput stage. So i created a dummy column and contanenated prd_name and ccy columns and used this dummy column as trigger columns. Now the tags and output format is coming as expected. But the dummy column data is also being traversed to the output xm file.
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>CR ACCOUNT-SPC</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
<dummy>CR ACCOUNT-SPC~IDR</dummy>
</datarow>
</accounts>
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>TEST PRODUCT NAME</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
<dummy>TEST PRODUCT NAME~IDR</dummy>
</datarow>
</accounts>
So now in the above xml the tags - dummy tag needs to be removed as it was used for grouping.
Expected output :
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>CR ACCOUNT-SPC</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
</datarow>
</accounts>
<accounts>
<datarow>
<prdcode>CABIP</prdcode>
<prdname>TEST PRODUCT NAME</prdname>
<acctnum>0712030100010001</acctnum>
<ccy>IDR<ccy>
</datarow>
</accounts>
Please can you let me know what needs to be done to achieve the desired output.