Hi,
For a parent multiple childs can be there,i need to concatenate all child records in one column in a row.I have used 3 stage variables.
s1=s2,s2=i/p column,s3=if s1=s2 then s1:',':s3 else i/p column
If i have 3 child records,i'm getting output as
1 row:1 ,
2nd row:1,2
3rd row :1,2,3
But i need only one row with 1,2,3 as my output
can anyone suggest some solution for me.
Thanks!
generating a single row from multiple rows
Moderators: chulett, rschirm, roy
Load that into a temp table, group by the key and get the last one. If you were on server, you could have achieved this by aggregator. I am not sure if the Last option is available in a parallel aggreagator.
Or, if the remove duplicate stage works like a hashed file stage, then pass it through the remove duplicate stage. This way you will retain the last record.
Or, if the remove duplicate stage works like a hashed file stage, then pass it through the remove duplicate stage. This way you will retain the last record.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Simply using a filter(constraint) on the number of commas will serve the purpose.DSguru2B wrote:O great. Then the Last option is going to work. Ive done something like that in the past and the last option works great.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
Make sure your data is sorted and partitioned on the key before using RemoveDuplicate stage.sravanthi wrote:Hi all,
Thanks for your suggestion.I have used remove duplicate stage and used retain last column it worked fine.
thanks! :D
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'