Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a input file like below
col1;col2;col3;……col10
1;a;1
1;b;5;
2;c;10
1;d;3
2;e;9
i have to group the records based on col1 and sort with col3
the output should be like
col1;col2;col3;…….col10
1;a;1;
1;d;3;
1;b;5;
2;e;9;
2;c;10;
rest of the other records in the file should remain same
please anyone have any suggestions
thanks in advance,
lmit
Hi
I think just use a tSortRow to sort the rows by col1 and col3 columns can fit your needs.
Regards
Shong
Hi @Shicong Hong ,
Thanks for your reply , yes sort worked
But i have to separate the records which are having only date , lets say my input is like
and my output should have 2 flows like
first flow should records like
and second flow should be like
the first flow is because it has only one date and one records in the whole file
the second flow will have other records in sorted ordered
i tried using taggregatrow component with count function but got error message like "cannot be processed because of incompatible input and/or out columns
Any suggestions would really apricate
Thanks,
lmit
I guess you don't use the tAggregaterow component correctly. In this example, you need to store the output into memory using tHashOutput after tSortRow for used in next subjob, for example:
tHashInput1 link with tHashOutput1, and has the same schema as tHashOutput1;
tHashInput1 link with tHashOutput2, and has the same schema as tHashOutput2;
Regards
Shong