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: 
bbastro1106
Contributor III
Contributor III

Count if (A value - B Value)>0

I am new for Qlik sense and I get stuck with a count if expression.

I would like to get a distinct count for [PO ID], if "quantity" - "original quantity" <> 0

My expression as below but I am not able to get the result at all.

Count(if(Quantity-[Original Quantity]>0,distinct [PO ID]))

2 Solutions

Accepted Solutions
VishalWaghole
Specialist II
Specialist II

Try below expression,

If((sum(Quantity)-sum([Original Quantity]))-=0, Count (Distinct [PO ID]))

Thanks,
Vishal Waghole

View solution in original post

bbastro1106
Contributor III
Contributor III
Author

Thanks!

i make some changes on the formula like the following and it works.

if((sum(Quantity))-(sum([Original Quantity]))<0 , Count (DISTINCT [PO ID]))

Thank you!

 

View solution in original post

3 Replies
ignacio_pena
Contributor III
Contributor III

Hi,

You can use the next expression:

if(Quantity-[Original Quantity]>0, Count (DISTINCT [PO ID]))

Regards,

VishalWaghole
Specialist II
Specialist II

Try below expression,

If((sum(Quantity)-sum([Original Quantity]))-=0, Count (Distinct [PO ID]))

Thanks,
Vishal Waghole
bbastro1106
Contributor III
Contributor III
Author

Thanks!

i make some changes on the formula like the following and it works.

if((sum(Quantity))-(sum([Original Quantity]))<0 , Count (DISTINCT [PO ID]))

Thank you!