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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression to populate zero for all excluded values in a selection

Hi All,

I am trying to populate zeros for excluded divisions for a product list.

= num(sum(Sales) +sum({1<Division = E(Division)>} 0) + if(substringcount(vVar1,Product)>0,0.0000000000000000001,0), '#,##0')

Variable definition

vVar1= Concat(Distinct Product,'|')

Problem

This expression includes values other than the current selection. How do we restrict the expression to limit data just to current selections.

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Can you use alt()?

-Rob

MarcoWedel

can you provide a sample app?

Anonymous
Not applicable
Author

Thanks guys. I found the answer to the problem.

I had to use the P() function to evaluate possible values. So it goes like this

= num(sum(Sales) +sum({1<Division = E(Division), Vendor = P(), [Merch Category] = P()>} 0)+ if(substringcount(vVar1,Product)>0,0.0000000000000000001,0), '#,##0')