on 07-23-2008 9:32 PM
Hi XI experts:
I have a mapping question. This is the TLOG message coming from a POS into XI and needs to be mapped to the target.
There are 2 types of nodes DTL (Detail) and DDC (Discount). They both have a common element DETAILNR. See the xml below.
I need to take the QUANTITYSOLD field from the DTL node and multiply with the AMOUNT field of the DDC node and pass the result for matching DETAILNR and map to a field at the target side.
The DTL and DDC nodes are at the same level, but the number of DTL nodes is more than that of the DDC node.
Your help will be appreciated,<removed by moderator>
Thank you.
<DTL>
<RECORDTYPE>DTL</RECORDTYPE>
<DETAILNR>0065</DETAILNR>
<QUANTITYSOLD>+0010</QUANTITYSOLD>
</DTL>
<DDC>
<RECORDTYPE>DDC</RECORDTYPE>
<DETAILNR>0065</DETAILNR>
<AMOUNT>+00000000.89</AMOUNT>
</DDC>
Edited by: Mike Pokraka on Jul 24, 2008 1:16 PM
>>but the number of DTL nodes is more than that of the DDC node.
You can use collapseContext before you multiple fields,it will basically insert null values if some fields are less or missing.
after collapseContext, just implement your mapping logic,it will multiple corresponding values from DTL and DDC.
Thanx
Aamir
Edited by: Aamir Suhail on Jul 23, 2008 4:17 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sameer,
The XML is:
Thank you.
<ns:MT_TLOG xmlns:ns="urn:nslc:xi:BeanStore:POSI001:Tlog">
<RecordSet>
<HDR>
<RECORDTYPE>HDR</RECORDTYPE>
<STORECODE>2367</STORECODE>
<TRADINGDATE>20080719</TRADINGDATE>
<TRANSACTIONTYPE>003</TRANSACTIONTYPE>
<TILLID>003</TILLID>
</HDR>
<DTL>
<RECORDTYPE>DTL</RECORDTYPE>
<DETAILNR>0013</DETAILNR>
<SKUCODE>00000000000001000893</SKUCODE>
<QUANTITYSOLD>+0001</QUANTITYSOLD>
</DTL>
<DTL>
<RECORDTYPE>DTL</RECORDTYPE>
<STORECODE>2367</STORECODE>
<SKUCODE>00000000000001001939</SKUCODE>
<QUANTITYSOLD>+0010</QUANTITYSOLD>
</DTL>
<DTL>
<RECORDTYPE>DTL</RECORDTYPE>
<STORECODE>2367</STORECODE>
<SKUCODE>00000000000001001493</SKUCODE>
<QUANTITYSOLD>+0010</QUANTITYSOLD>
</DTL>
<DTL>
<RECORDTYPE>DTL</RECORDTYPE>
<STORECODE>2367</STORECODE>
<SKUCODE>00000000000001001493</SKUCODE>
<QUANTITYSOLD>+0010</QUANTITYSOLD>
</DTL>
<DDC>
<RECORDTYPE>DDC</RECORDTYPE>
<DETAILNR>0075</DETAILNR>
<AMOUNT>+00000000.89</AMOUNT>
</DDC>
<DDC>
<RECORDTYPE>DDC</RECORDTYPE>
<DETAILNR>0065</DETAILNR>
<AMOUNT>+00000000.89</AMOUNT>
</DDC>
<TAX>
<RECORDTYPE>TAX</RECORDTYPE>
<STORECODE>2367</STORECODE>
<TILLID>003</TILLID>
<TRANSACTIONNR>00018947</TRANSACTIONNR>
<TAXNR>0001</TAXNR>
<TAXMETHOD>01</TAXMETHOD>
<AMOUNT>+00000734.97</AMOUNT>
</TAX>
</RecordSet>
</ns:MT_TLOG>
Hi,
Are DTL and DDC nodes are sorted on DETAILNR?
If yes, you can use DTL/DDC --> removecontext --> split by value on value changed --> user defined function to pass 2 contexts DTL, DDC and multiply all DTL values with DDC --> splil by value ---> target field
Thanks,
Beena.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use SortByKey to sort the amount and quantity where key will be DETLNR.
DETLNR (remove context) and Amount (remove context)---> sort by key --> split by value on value change
DETLNR (remove context) and quantity (remove context) ---> sort by key --> split by value on value change
Pass these two to user defined function and multiply.
Thanks,
Beena.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.