Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
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
chris_deniziak
Creator
Creator

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
mov
Champion III
Champion III

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.

chris_deniziak
Creator
Creator

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

Not applicable
Author

thanks a ton