Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bbastro1106
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
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

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,

Thanks and Regards
Kashyap.R
Anil_Babu_Samineni

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)
sunny_talwar

May be this

 

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