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

Apply 'Count' to result of 'Aggr'

I want to use the results of the following table to create a KPI: 

Screen Shot 2021-12-31 at 00.50.33.png

The KPI I want to create is the 90 from the right column. In order to access 90, I need to apply 'Count(DISTINCT OrderID)' to the first row of the 'Aggr()'-result in the same expression. How can I achieve that? 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try something like (with reverse condition to get the false output):

Count(Distinct{<[customers$.CompanyName]={"=Count(Distinct OrderID)<=10"}>} OrderID)

View solution in original post

4 Replies
vikasmahajan

Hi,

Try this 

FirstSortedValue(DISTINCT Customer, Rank(Count(Distinct OrderID), 4, 1), Customer)

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Luca1
Contributor III
Contributor III
Author

Hey, your solution yields the following error:

Screen Shot 2021-12-31 at 09.59.24.png

tresesco
MVP
MVP

Try something like (with reverse condition to get the false output):

Count(Distinct{<[customers$.CompanyName]={"=Count(Distinct OrderID)<=10"}>} OrderID)

Luca1
Contributor III
Contributor III
Author

Your support is superb guys, thank you!