Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
KKumar92
Contributor III
Contributor III

Count a Field when Two Conditions are True

Hello Qlik World,

I am working on a procurement dashboard, in order to calculate a particular KPI I have created two measures as follow;

Measure 1 : Received Date - Confirmed Date

Measure 2 : Received Qty - Confirmed Qty

I want to Count the number of Records, where the Value of Measure 1 and 2 is equal to 0 [both conditions has to be true].

I have used the following command in the expression, but I did not get expected results.

(count(if( received_date - confirmed_date = '0' and received_qty - confirmed_qty = '0', order_no)))

Your guidance and support on the above will be highly appreciated.

Labels (2)
1 Solution

Accepted Solutions
Taoufiq_Zarra

One solution :

=count({<order_no={"= [Confirmed Date]-[Received Date] =0  "}*{"= [Confirmed Qty]-[Received Qty] =0  "}>} order_no)

 

an example :

Capture.PNG

 

in this case its orderno 1 and 2

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

3 Replies
Or
MVP
MVP

Other than the unnecessary use of quote - you're comparing to the number zero, not the string '0' - I don't see anything wrong.

Taoufiq_Zarra

One solution :

=count({<order_no={"= [Confirmed Date]-[Received Date] =0  "}*{"= [Confirmed Qty]-[Received Qty] =0  "}>} order_no)

 

an example :

Capture.PNG

 

in this case its orderno 1 and 2

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Can you upload a sample data?