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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
dmxmikey
Creator
Creator

maxstring to return data if contains Y

mike3.JPG

Im trying to return word Egg on my table on Field that says Y and Blank if its N of blank.

Database contains Y,N and blank

11 Replies
Anil_Babu_Samineni

This is the case, I don't think whether you need MaxString(). Why not simply IF condition without MaxString() function

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Where exactly are you using Y, N? on which field I mean?

dmxmikey
Creator
Creator
Author

The Y,N is the alg-stat

dmxmikey
Creator
Creator
Author

sorry how will the if command look like?

sunny_talwar

But you are testing for values such as GLUT, EGG against alg-stat? Does it contain both?

Anil_Babu_Samineni

My intention is this?

Load Distinct [p-code],

[alg-code],

If(Match([alg-code],'GLUT','EGG','CRUS'), 'Y', 'N') as Flag

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dmxmikey
Creator
Creator
Author

Alg-code
CakeY
cokeN

the data looks like this on Database, where Y,N are Alg-stat,

so what i need to achieve is where Y i need it to say Egg and N to be blank. This is just for the Egg Alg-code

dmxmikey
Creator
Creator
Author

Alg-code
CakeY
cokeN

the data looks like this on Database, where Y,N are Alg-stat,

so what i need to achieve is where Y i need it to say Egg and N to be blank. This is just for the Egg Alg-code

Anil_Babu_Samineni

May be this?

Load Distinct [p-code], If([Alg-code]='Y', 'Egg', 'Blank') as Egg;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful