Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

IF Condition Formula with Exclusion

Hello!  Pls. help me fix my formula in my chart expressions.

This is my current formula that works currently where it's applicable to all field TYPE ...


IF ([Status]='Active',SUM({<KeyFig3= {'Demand'}>} Value),SUM({<KeyFig2 = {'ActualPO}>} Value))

However , I need to revise the formula   that it will be applicable  only if the  field TYPE = CD...Thus, If TYPE <>CD,the should be SUM({<KeyFig3= {'Demand'}>} Value)

Tks.

3 Replies
Sokkorn
Master
Master

Hi,

I may not understand you well, but let give a try

IF ([Status]='Active' and [TYPE]<>'CD',SUM({<KeyFig3= {'Demand'}>} Value),SUM({<KeyFig2 = {'ActualPO}>} Value))


Regards,

Sokkorn

jagan
Luminary Alumni
Luminary Alumni

HI,

If you want to compare multiple conditions in If() then use AND/OR like below

IF ([Status]='Active' AND [TYPE] <> 'CD',SUM({<KeyFig3= {'Demand'}>} Value),SUM({<KeyFig2 = {'ActualPO}>} Value))


Regards,

Jagan.

Anonymous
Not applicable
Author

Hi!  Jagan,

    I already tried to use this formula before ( also used OR)  but it didn't work...

   THE Type field varies by Status...like CD type could be active or inactive...  What I like is when the Type is CD whether Status is active or inactive it will be SUM({<KeyFig3= {'Demand'}>} Value)...Otherwise,  If  the TYPE it's not  CD then the IF condition applies IF ([Status]='Active' ,SUM({<KeyFig3= {'Demand'}>} Value),SUM({<KeyFig2 = {'ActualPO}>} Value))...

I hope I have explained this better...

Tks.