Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
realpixel
Contributor III
Contributor III

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?

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

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
Employee
Employee

Maybe using Set Analysis makes things easier

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

Clever_Anjos
Employee
Employee

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

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
Contributor III
Contributor III
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.