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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to pass single table row values

hello,

in my scenario

i want to find difference between row 1 and row 2 then 2 and 3 and so on.

my table type is ..

id, object_Lattitude, object_longitude

1, 41.273,-72.236

2,1, 41.277,-72.236

3,1, 41.252,-72.236

 

i use this components to find difference between

tDbinput --.> tjavarow-->tDboutput, i also write routines 

 

tJavarow--> latA, longA, latB & longB  and  

ques:- i want to pass 1st row data as  latA, longA, 2nd row data as latB & longB

 

thanks in advance,

regards , 

Manish

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

   Could you please refer the below post which is having solution to similar query?

 

https://community.talend.com/t5/Design-and-Development/How-to-get-previous-row-tuple-s-value-without...

 

You may have to make minor changes to suit your specific use case.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi,

 

   Could you please refer the below post which is having solution to similar query?

 

https://community.talend.com/t5/Design-and-Development/How-to-get-previous-row-tuple-s-value-without...

 

You may have to make minor changes to suit your specific use case.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

nfz11
Creator III
Creator III

Use tMemorizeRows.  The example in the documentation is very similar to what you need:

https://help.talend.com/reader/mjoDghHoMPI0yuyZ83a13Q/0oEBI6YCTFXSgc5Z9Gpr6Q

 

If you set 'Row count to memorize' to 2, you can reference the current row as index 0 and the last row as index 1.  In your tJavaRow component, you can compute the difference:

 

int latDifference = object_Lattitude_tMemorizeRows_1[0] - object_Lattitude_tMemorizeRows_1[1];
int lonDifference = object_longitude_tMemorizeRows_1[0] - object_longitude_tMemorizeRows_1[1];

 

Anonymous
Not applicable
Author

thanks  @nthampi  sir for help, the solution is working !!