Skip to main content
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Count with 2 conditions

Hi All,


I am now working on a expression to perform a distinct count for SKU number,  if 2 criteria match:

1) If PO total units <> 0

2) If PO total Unit - Original Unit < 0

I try below expression, but it cannot give me the correct result.

Count(Distinct {<[SKU Number]={"=Sum({$<[PO Total Units] = - {0}>} [PO Total Units]-[Original Units])<0"}>} [SKU Number])

4-25-2019 4-45-33 PM.jpg

Can anyone please help?

3 Replies
Partner - Specialist
Partner - Specialist


Hope this solution works for you,

if(Sum([PO Total Units]) >=600 and (Sum([PO Total Units])-Sum([Original Units])) > 30,Count(distinct [SKU Number]),0)


Thanks and Regards

Perhaps this way?

Count(Distinct {<[SKU Number]={"=Sum({$<[PO Total Units] -= {'0'} and ([PO Total Units]-[Original Units])<0">} [SKU Number])

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

May be this


Count(DISTINCT {<[PO Number] = {"=[PO Total Units] <> 0 and [PO Total Units] - [Original Units]) < 0"}>} [SKU Number])