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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with the If condition on a field with multiple Values

Hello All,

Can anyone tell me what's wrong with the below if condition?

Load

if(ManagedBy = 'Third Party', 'All3rdParty',

if( ManagedBy = 'Third Party' and ManagedBy = 'ABC', 'SOME3rdParty',

if(ManagedBy = 'Third Party' and ManagedBy = 'DEF', 'SOME3rdParty',

if (ManagedBy = 'Third Party' and ManagedBy = 'ABC' and ManagedBy = 'DEF', 'SOME3rdParty',

if (ManagedBy = 'ABC' and ManagedBy = 'DEF', 'SOME3rdParty','NO3rdParty'))))) AS Has3rdParty, ID

RESIDENT ABC;

So, basically I'm trying to check one of the conditions. Suppose if an ID has 3 differnent values of ManagedBy field , it should directly go to condition #4 in this case..and should display "Some3rdParty' as the value.

I'm not sure how can i use the OR condition. I mean it should check for each ID which condition is TRUE and just return only one value from the above.

Thank you.

2 Replies
jemancilla
Contributor III
Contributor III

Could you add an example of your table?

chriscammers
Partner Ambassador
Partner Ambassador

your expression as you have it will not work. you have the same field matching 2 different values. I wrote a blog post that I think gets at what you were trying to accomplish. here is a link http://biventure.blogspot.com/2011/09/wild-thing-ill-map-your-pattern-strings.html?m=1 check it out and let me know what you think.

good luck

Chris