Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Dylangkx
Contributor II
Contributor II

Getting sum of a aggregated field based on 2 other fields.

Hi all,

I'm trying to obtain a sum of an aggregated field by 2 different fields (Country and Unique ID)

The base field that I am trying to sum up is as follows:

Count({<[Vehicles] = {1}>} distinct Unique_ID1 & Unique_ID2

I have tried to use this formula 

Sum(Aggr(Sum( (Count({<[Vehicles] = {1}>} distinct Unique_ID1 & Unique_ID2))), Unique_ID2, Country))

but it seems to return me only 0s for the whole column. Would appreciate if there are any solutions to this or if anyone needs clarifications on the question!

Labels (1)
1 Reply
BrunPierre
Partner - Master II
Partner - Master II

Try

Sum(
Aggr(
Count({<[Vehicles] = {1}>} distinct Unique_ID1 & Unique_ID2)
, Country, Unique_1D2)
)