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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting count based on an expression

Hi,

In the below expression I am trying to find the count of distinct products for which % Change in Cost is >=0.

=

COUNT({<Product={"=if((Sum( {1<Product=p(Product)>} Cost) -

Sum( {1<Product=p(Product)>} Cost_Change))=0,0,

Sum( {1<Product=p(Product)>} Cost_Change)/

(Sum( {1<Product=p(Product)>} Cost) -

Sum( {1<Product=p(Product)>} Cost_Change)))>=0"
} >} DISTINCT Product)

But this expression is not returning a correct value if denominator is zero ie if

Sum( {1<Product=p(Product)>} Cost) -

Sum( {1<Product=p(Product)>} Cost_Change)=0

Thanks,

Amit

Labels (1)
0 Replies