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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
realpixel
Creator
Creator

SUM IF

Hello,

I have the following expression

=sum(if((IDEFAC='L'),MFAC))

It's works fine, now I want to add for value IDEFAC 'L' and  'N' and 'S' and 'F'

I try this expression

=sum(if((IDEFAC='L' and IDEFAC='N' and IDEFAC='S' and IDEFAC='F'),MFAC)) but it's not works

Someone have an idea?

Labels (1)
1 Solution

Accepted Solutions
Clever_Anjos
Support
Support

But if you insist using IF

=sum(if((IDEFAC='L' OR IDEFAC='N' OR IDEFAC='S' OR IDEFAC='F'),MFAC))

View solution in original post

6 Replies
Clever_Anjos
Support
Support

Maybe using Set Analysis makes things easier

=sum({<IDEFAC={'L','N','S','F'>}MFAC))

Clever_Anjos
Support
Support

But if you insist using IF

=sum(if((IDEFAC='L' OR IDEFAC='N' OR IDEFAC='S' OR IDEFAC='F'),MFAC))

MK_QSL
MVP
MVP

SUM({<Customer_Name = {'A','B','C','D'}>}QTY)

MayilVahanan
MVP
MVP

Hi

Try like this

=sum({<IDEFAC={'L','N','S','F'>} MFAC) // or function

or

=sum({<IDEFAC={'L'}> * <IDEFAC={'N'}> * <IDEFAC={'S'}> * <IDEFAC={'F'}>} MFAC) // And Function

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
realpixel
Creator
Creator
Author

Thank you Clever,

Expression under works fine

=sum(if((IDEFAC='L' OR IDEFAC='N' OR IDEFAC='S' OR IDEFAC='F'),MFAC))

MK_QSL
MVP
MVP

FYI .... IF is much slower compare to SET ANALYSIS.