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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
lmit
Creator II
Creator II

Flag changing in tmap

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

Labels (2)
21 Replies
lmit
Creator II
Creator II
Author

screenshot is not allowed to take,jib flow is as below

 

inputfile --> tuniqrow --> tmap --> outputfile

 

i appiled uniqrow on both columns id and flag

 

the output is :

1,N

1,Y

2,N

thanks,

lmit

manodwhb
Champion II
Champion II

why you used tuniqrow?i asked you to do sort using tSortrow

lmit
Creator II
Creator II
Author

sorry , my mistake i used tsortrow only

Anonymous
Not applicable

row2.flag.equals("Y") ? "N": StringHandling.LEN(row2.flag)==0 ? "Y": row2.flag

 

use this expression


Capture.PNG
manodwhb
Champion II
Champion II

Could you please let me know the conditions and variable port in tMap

Anonymous
Not applicable

hi pls find the attachment.

 

Thanks

Venkata Kiran


Capture2.PNG
manodwhb
Champion II
Champion II

Please find the attahced code.


Flag_changing.zip
Anonymous
Not applicable

thats a good one bro

manodwhb
Champion II
Champion II

If this help please give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

manodwhb
Champion II
Champion II

@lmit still you have issue?