Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tjavaFlex instead of tjavaRow ?

Hi,
my input is:
date;type;name;value
2009-07-10;X;A;1.2
2009-07-10;X;B;2.1
2009-07-10;Y;A;3.1
2009-07-11;X;B;1.5
Output is expected:
date;type;A;B
2009-07-10;X;1.2;2.1
2009-07-10;Y;3.1;null
2009-07-11;X;null;1.5
This transformation can easily be handled with tPivotOutputDelimited, but the performance is lousy (50.000 records take 30 minutes).
I have then used tjavaRow to gather the counters per date/type-key in variables and write the output after all counters are gathered. This can be done after the date/type-key changes. In the case of my example it means that the first line
2009-07-10;X;1.2;2.1
will be written when the third input line is processed and the 2nd line
2009-07-10;Y;3.1;null
willbe written when the fourth input line is processed.
This works much faster than the pivot-function but one issue is still open:
The last output line will never gets written since tjavaRow will not be called afterward.
Hence I need an exit-routine to write out the stored values for last date/type-key.
How can I carry out this task?
Can I use tjavaFlex instead of tjavaRow for processing input rows? (tjavaFlex has the "End Code" section)
I have tried it with the following error:
The schema from the input link "row1\" is different from the schema defined inside the component
Thanks for help!
Labels (3)
12 Replies
Anonymous
Not applicable
Author

Have a good holiday!
Anonymous
Not applicable
Author

Hi Volker,
seems that tAggregateRow solves my task perfectly. Performance is high (150.000 lines within 1 second).
Since my input is already sorted I understand that tAggregateSortedRow could even be better (I guess it saves the sorting step).
tAggregateSortedRow has an additional field "Input rows count" (__ROW_COUNT__) which i don't understand. What is it for?
Regards
Günter
OK, I read the many posts regarding this issue. Seems that I should stay with the tAggregateRow.
Anonymous
Not applicable
Author

Hi Günter,
I don't know what "Input rows count" is used for. Maybe you will find some information in the documentation.
Bye
Volker