Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi,
Could you please refer the below post which is having solution to similar query?
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 🙂
Hi,
Could you please refer the below post which is having solution to similar query?
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 🙂
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];
thanks @nthampi sir for help, the solution is working !!