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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
GeosoftRim
Contributor III
Contributor III

Aggregation

Hello ,
I want to calculate the number of REFTDR per REFTPT. to subsequently visualize the average of the number calculated by company.
(I hope I explained my need well)
thank you in advance

GeosoftRim_0-1620717615664.png

 

3 Replies
Dalton_Ruer
Support
Support

I think this is what you are looking to do:

Dalton_Ruer_0-1620743907193.png

The script is:

Avg(Aggr(Sum(refdti), reftpt))

 

GeosoftRim
Contributor III
Contributor III
Author

Thank you for the answer, yes that's the expected except that I just want the count and not the sum and I can change it there is no problem.
But the request generates an infinite loop of the calculation, is that normal?

Dalton_Ruer
Support
Support

Shouldn't be an infinite loop, that wouldn't be normal as AGGR can handle Count aggregation just like it would handle Sum. It works in just the same way I displayed the two tables above. It first builds an In-Memory table with the aggregation at whatever dimension level you pass it, that you can then tap into. I always recommend doing similar for those trying to get familiar with the function so that they can visualize what would be in memory. 

If you are getting an error it may have to do with some data values or something. So first building a table with the Count function might explain why. If not, it is something you could report to support.