Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

multiple if condition

hi,

i have 2 listboxes

1- Region

2- Domain ('Mops','WEB','Reports')

there is a possibility that user selects 2 fields from domain. each selection has a different output.

i have written the below if condition. however this fails since wildmatch acts as or and not if...

if(GetSelectedCount(Region)=0 AND GetFieldSelections(Domain)='MOPS',8.00,

if(GetSelectedCount(Region)=0 ANDWildMatch(GetFieldSelections(Domain),'*MOPS*','*Reports*') ,10.00,

if(GetSelectedCount(Region)=0 ANDWildMatch(GetFieldSelections(Domain),'*WEB*','*Reports*') ,13.00,

if(GetSelectedCount(Region)=0 ANDWildMatch(GetFieldSelections(Domain),'*WEB*','*Mops*') ,13.00,

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Yousuf,

You need to watch spacing with QV, it can be tricky. You were missing a space and capitalization matters!

View solution in original post

6 Replies
Anonymous
Not applicable
Author

What about this approach:


wildmatch(GetFieldSelections(Domain),'*Mops,Reports*')

anbu1984
Master III
Master III

=if(GetSelectedCount(Region)=0 AND GetFieldSelections(Domain)='MOPS',8.00,

if(GetSelectedCount(Region)=0 AND WildMatch(GetFieldSelections(Domain),'*Mops*,*Reports*') ,10.00,

if(GetSelectedCount(Region)=0 AND WildMatch(GetFieldSelections(Domain),'*Reports*,*WEB*') ,13.00,

if(GetSelectedCount(Region)=0 AND WildMatch(GetFieldSelections(Domain),'*Mops*,*WEB*') ,13.00,0))))

sujeetsingh
Master III
Master III

Michel, has given the best and the optimised way to achieve these nested if logic.

Not applicable
Author

Didnt work...

in the attched file i selected mops and reports. so theo output should be 10.but its showing 0.

Anonymous
Not applicable
Author

Yousuf,

You need to watch spacing with QV, it can be tricky. You were missing a space and capitalization matters!

Not applicable
Author

thanks a ton