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

IF FUNCTION

Hi!

This expression returns SALES for only D instances, and i would want both C and D.

= SUM(IF(LEFT([FIELDNAME],1) = 'C','D', (SALES)))

Thanks

3 Replies
er_mohit
Master II
Master II

try this

= SUM(IF(LEFT([FIELDNAME],1) = 'C' or LEFT([FIELDNAME],1)='D', (SALES)))

or

= SUM(IF(LEFT(wildmatch([FIELDNAME],'C','D'),1) , SALES))


Anonymous
Not applicable
Author

We can simplify it a little:

SUM(IF(wildmatch([FIELDNAME],'C*','D*'), SALES))

VishalWaghole
Specialist II
Specialist II

Hi

Try this

SUM(IF(match(LEFT([FIELDNAME],1),'C','D'), SALES))

or

SUM(IF(wildmatch([FIELDNAME],'C*','D*'), SALES))

Thanks