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: 
Not applicable

if and 'and condition'

hi,

i am using if and 'and condition'. when i ise 2 and condition, output comes correct. howevr, when i use the 3rd condition, i dont get any output

=if(GetFieldSelections(Region)='EMEA' AND GetFieldSelections(Domain)='MOPS' AND GetFieldSelections(Domain)='Reports',3.67) 

help on this would be appreciated

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

OK so when you use GetFieldSelections you'll want to do this:  WildMatch(GetFieldSelections(Domain),'*MOPS*','*Reports*')

View solution in original post

17 Replies
Anonymous
Not applicable
Author

You are saying if the Domain field selection equals MOPS and it also equals Reports. Are you meaning to do this?

Not applicable
Author

yes, i have 2 listboxes...if i select both mops and reports from my second listbox and select only 'emea' from my first listbox, then i should get the value 3.67

maxgro
MVP
MVP

any output because

Domain can't be at the same time MOPS and Reports

Not applicable
Author

then how to rewrite the expression, i have selected 2 values(mops, reports) from the 2nd listbox and 1 value(emea) from the 1st listbox....

maxgro
MVP
MVP

add a textbox

with           =GetFieldSelections(Domain)

Anonymous
Not applicable
Author

OK so when you use GetFieldSelections you'll want to do this:  WildMatch(GetFieldSelections(Domain),'*MOPS*','*Reports*')

Not applicable
Author

thanks a lot..it worked

Not applicable
Author

there is another probm here. i m using nested if. so if i write the first condition and only mops is selected it returns vale as 10 instead of 8. how to fix this?

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

Anonymous
Not applicable
Author

Looks like you are running into an error in the order of operations... The first statement says that if the Domain select has Mops then it's true... reverse the statements and it will work.