Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Did not get yet when to use the Aggr() function and when not.
Sometimes facing up in situations where everything is working correct except when I want to show data, like below in a table, with aggegate value on the top (Gesamtwerte). Without using Aggr() the aggreagate values are sometimes wrong. E.g. in my example Column 5 ("Eingegang Anruf"). Total 6587 is wrong, correct is 6828.
So I use then Sum(Aggr(...) and it is fine. But on the other hand, when I use the objects alone, not in a table, I get wrong results. So that means I have to put every dimensions in the Aggr() function. But this has an other bad impact. performance of the app! Many times the App and the hole Qlik Engine are struggling and crashing (see one error below).
Can anybody help?
Thanks
George
Are you sure that 6587 is wrong? Could it be that a transaction row could be connected to more than one "Gemensamwerte" dimension value? If so then the sum of rows will not neccesary be equal to the expresion total.
Consider my attached example where I have transaction per country, but some of the countries are associated to more than one geographical region. In this case the rows are correct, but the aggr() total is not even if it is equal to the sum of rows.
Hi Vegar,
Do understand your comments. In my case I have only one table, not linked with others. That's the reason why I do not understand it.
However I understood to use both variants, one with and one without Aggr(). But the problem I do have is that Aggr() is using too much ressources, so Qlik crashes. Do you have an Idea who to avoid it? Maybe I can load Aggr()-"Tables" in the load script to have precomputed values? If possible, how do I have to implement it?
What about NULL values? Are you limiting you table to exclude NULLs?
set NullInterpret ='';
LOAD * inline [
Country, Amount
Norway, 10
Sweden, 10
Denmark, 10
Finland, 10
Iceland, 10
, 10
];
just checked. Limiting with and without NULLs brings the same result.
It is a Distinct problem. So I have to use the Aggr() function.
Count(Distinct {<Calldirection={'Inbound'}, [EventType]={'TALKING'}>} CallId)
/
Count(Distinct {<Calldirection={'Inbound'}>} CallId)
Is there a way to avoid using Aggr() ? Maybe I can do something in the load-script?