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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Specialist
Specialist

Nested aggregation problem

Hi experts

How do we script this challenge? the code below gives "nested aggregation not allowed":

Sum({<[days]={">-6<1"}, [Year]={$(=max([Year]))}>} Count([ID])) / Count([ID])

Thanks for any advice

Tom

1 Reply
marcus_sommer
MVP
MVP

You need an aggr() for it. Something like this:

sum(aggr(count(ID), Dim1, Dim2)) / count(ID)

whereby Dim1, Dim2 are placeholder for the dimension in which context the calculation should happens - usually all dimensions from the object.

- Marcus