Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a requirement where I need to change flag from y to n based on a condition.my data looks like below
Id;flag
1;y
2;y
1;
My output should be
Id;flag
1;n
2;y
1;y
If ids are same and have a flag value as y then it has to change to n and if the flag is null it has to change to y
Can anyone Suggest a solution, if so would be a great help.
Thanks in advance,
Lmit
Hello,
You can use ternary operator for if-else scenario in tMap or join your two tables.
Condition?value if true:value if false
Best regards
Sabrina
Hi Sabrina,,
Thanks for your reply . but can you be little bit clear about what you said??
Thanks in advance,
lmit
Hi,
Thanks manohar for the reply.
the data in file can have n number of rows with same id and other ids which are not same like
id,flag
1,Y
2,Y
3,Y
1,
1,Y
both the id's 1 with flag Y should be become N and with null should become N
but id's 2 with flag Y should be Y only
Thanks,
lmit
since you can sort the data based on Id Asc and Flag Asc order in tSortrow,you wil lget in required way and then you can compare in tmap and derive new flag.
If this help please give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
still you have issue?
Yes Manohar,
Flag still not changing, after sorting and comparing also the flag is not changing.
for both values its changing, i mean for all values where Y is there is getting changed to N
Thanks,
Lmit