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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
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

0 Replies