Could someone help me figure out why the Distinct Child Element property on a Simple Loop is not working in this situation..
I have a simple flat file that has IDs and Zipcodes.
id;zipcode 1;44100 1;44200 2;69002 2;56410 2;56100
I want the output to look like:
<Root> <Record> <id>1</id> <Zips> <Zipcode>44100</Zipcode> <Zipcode>44200</Zipcode> </Zips> </Record> <Record> <id>2</id> <Zips> <Zipcode>69002</Zipcode> <Zipcode>56410</Zipcode> <Zipcode>56100</Zipcode> </Zips> </Record> </Root>
However when I use the Distinct Child Element and set it to "id", it only brings back the first ID, number 1. ID #2 is ignored. The result is:
<Root> <Record> <id>1</id> <Zips> <Zipcode>44100</Zipcode> <Zipcode>44200</Zipcode> </Zips> </Record> </Root>
Screenshot of the mapping:
It is odd because this Distinct Child Element component works with an XML input, as can be seen in the example given on this post. But why did the user need to create a 2nd map just to filter get the unique list and why couldn't they have done it in just 1 mapping? Instead they had to create a 2nd mapping just for the Distinct Child Element setting.
Solved! Go to Solution.
Is it possible this could be a bug? I didn't find anything specifically related in the report issues. This ticket here might be but the thing I'm trying to do a distinct on is not looping itself, it is within a loop.
That looks like it worked!! How did you know to use "Flat:"? Also do you know if I have to use something else if my input is a "Map" (dataflow from within Talend) instead of an input of a CSV? I will be testing this out with Map input soon.
Watch the recorded webinar!
Introduction to Talend Open Studio for Data Integration.
Test drive Talend's enterprise products.
Practical steps to developing your data integration strategy.