Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ashley33
Contributor II
Contributor II

Count of expression which is a division

Hi All 🙂

I am trying to count the Items where the division of Total_Stock divided by Average_Shipment = 1.

Also the CategoryNew must be equal to 1

 

= count({$< Total_Stock = {1}, CategoryNew = {1}>} Item)        This first expression is working.

But when i try the division it is not working as shown in the 2nd expression below:

= count({$< Total_Stock/Average_Shipment = {1}, CategoryNew = {1}>} Item)

Can you please help?

Labels (1)
2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

The LHS of a set expression filter must be a field name; it cannot be an expression. This may work (depending on your underlying data:

 

=Count({$<Item = {"$(=Total_Stock/Average_Shipment = 1)"}, CategoryNew = {1}>} Item)

 

Or

 

=Count({$<CategoryNew = {1}>} If(Total_Stock/Average_Shipment = 1, Item))

 

 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Ashley33
Contributor II
Contributor II
Author

Thank you for the expression. I have tried it but even though there are values to be counted, im getting the count result = 0.

The count should be greater than 0 according to my data.

what can i modify in the expression?