Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have sorted my data based on a column called 'PolicyMembID'. I need to compare each consecutive row and if the value in the current row is different from the value in the previous row ,I mark it as "1" else it remains "0".(Both these columns have String data type)
I've used this expression after the tMemorize component :
row6.p1policymemberid.equals(((String[]) globalMap.get("tMemorizeRows_1_p1policymemberid"))[1]) ?
"0":"1"
I am getting the below error.
"Exception in component tMap_11 (FlagUniques)
java.lang.ArrayIndexOutOfBoundsException: 1
at regeneron.flaguniques_0_1.FlagUniques.tFileInputDelimited_3Process(FlagUniques.java:7856)
at regeneron.flaguniques_0_1.FlagUniques.runJobInTOS(FlagUniques.java:8417)
at regeneron.flaguniques_0_1.FlagUniques.main(FlagUniques.java:8266)"
Please advise?
Hi
I think the problem you're having is that the first time through, there is no "previous" row to compare it to, and you are unsafely getting the memorized value and using array position 1.
Thanks
David
If these answers are useful, don't forget to give Kudos
Yes, I found a workaround for this.
Instead of using the tMemorize component I used a tMap to create a new column having value of the previous row.I then compared the existing policymemberid column with the new column and marked it as 1 if the values were different and 0 if they were the same