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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issues with Aggr function with dates and targets

Hi Guys,

I have 2 expressions called A and B, both of which are trying to count the number of days an agent worked and multiplies it by a target value unique to them. Neither of which are doing it correctly.

I'm using the following formulas to try and calculate this;

Expression A:

Sum(Aggr(Count(DISTINCT CallDate & Agent) * [Total Target],Agent))

and

Expression B:

COUNT({$<[Cam/Acc] = {'Account'}>}Distinct CallDate & Agent) *

(Sum({$<[Cam/Acc] = {'Account'}>}[Total Target]) / COUNT({$<[Cam/Acc] = {'Account'}>}DISTINCT Agent))

Expression A gives me the correct total, however, when viewed in a table against Dimension 'CallDate', it seems to show the outcome of the expression against random Calldates.

Expression B gives me the correct values by dimension but the total is incorrect and changes when the dimesion is cyclic (CallDate - Week - Month).

I've attach the file so you can see what i mean.

Thank you in advance.

Regards,

Nick

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

sum(aggr(sum([Total Target]),CallDate)) maybe?


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

sum(aggr(sum([Total Target]),CallDate)) maybe?


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks G Wassenaar!,

Spot on!