Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am creating a job which take input from db and insert in excel file sheet. I want to compare current row with the previous row in excel and get unmatched row copied in to another file. Is that comparing possible?
If yes, Please help me in doing that.
If no, How can I achieve this in alternate way.
Thanks in advance.
Meghana.
Yes @aashish you are correct,
we can achive it using tMemorizeRow , but one need to write custom Java code in tJava components.
tMap can keep values between rows and its process from top to bottom order. we can configure to hold the last value of particular columns and compare them with the current row column.
yes you are right if we want to keep more than 2 rows in memory we can use tMemorizeRow, as it can be configured to keep n number of rows in memory.
its also possible with tMap, by increasing no of variables.
we can pick any logic as per our complexity.
Thanks,
Sachin D
Yes, it can be done using tMap, by keeping previous row column values in variable.
if you want to compare multiple columns with previous rows, you need to add more variables.
I my example i have just compared ID column, you can take more columns if needed.
and add some more logic as per your requirement.
click Accept the solution if it helps,
Also kudos are welcome
Sachin.
Hi @MeghanaKottala,
Appreciate your efforts @SachinD but tMemorizeRow is the component to compare data with previous row.
Yes @aashish you are correct,
we can achive it using tMemorizeRow , but one need to write custom Java code in tJava components.
tMap can keep values between rows and its process from top to bottom order. we can configure to hold the last value of particular columns and compare them with the current row column.
yes you are right if we want to keep more than 2 rows in memory we can use tMemorizeRow, as it can be configured to keep n number of rows in memory.
its also possible with tMap, by increasing no of variables.
we can pick any logic as per our complexity.
Thanks,
Sachin D
Thanks for the response.
I have used tJava component and stored previous value as context variabe as I need only one value to remember. It's working fine.
Thanks,
Meghana.