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

Using Max, Aggr, and Count together

Having trouble with the following expression. 

=count(distinct if(max(aggr(count(distinct EDI_UPC),PO#,EDI_CARTON_NUMBER))=1,PO#))

I'm attempting to count the number of PO#'s that have a maximum of 1 EDI_UPC in any EDI_CARTON_NUMBER.

This portion of the expression is working fine:

=max(aggr(count(distinct EDI_UPC),PO#,EDI_CARTON_NUMBER))

 

Labels (6)
1 Solution

Accepted Solutions
sunny_talwar

How about this

=Count(DISTINCT {<[PO#] = {"=Max(Aggr(Count(DISTINCT EDI_UPC), PO#, EDI_CARTON_NUMBER)) = 1"}>} [PO#])

View solution in original post

1 Reply
sunny_talwar

How about this

=Count(DISTINCT {<[PO#] = {"=Max(Aggr(Count(DISTINCT EDI_UPC), PO#, EDI_CARTON_NUMBER)) = 1"}>} [PO#])