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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
OKMBryan
Contributor
Contributor

Set Analysis - using with sum(aggr(count

Hi,

I have a chart in my application which uses the following expression and works great.

sum(aggr(count(distinct CONTRACT_ID),C_MCH_CODE,C_MONTH))

However - what I would like to do is stop  this expression being a affected by the selection of a certain field (that field being a date called "task_end" )

I can sucessfully do this to a certain point by using :

sum({$<[TASK_END] = >}distinct CONTRACT_ID))

However when I try to include the aggregation and count to the formula  I cant seem to get the set analysis to stop the "task_end" field from affecting my expression.

Any help would be greatly appreciated!

Thank you!

Bryan

1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

because of the second calculation for aggregation fields you have to exclude selection in field TASK_END also

 

sum({$<[TASK_END] = >} aggr(count({$<[TASK_END] = >} distinct CONTRACT_ID),C_MCH_CODE,C_MONTH))

 

 

View solution in original post

2 Replies
martinpohl
Partner - Master
Partner - Master

because of the second calculation for aggregation fields you have to exclude selection in field TASK_END also

 

sum({$<[TASK_END] = >} aggr(count({$<[TASK_END] = >} distinct CONTRACT_ID),C_MCH_CODE,C_MONTH))

 

 

OKMBryan
Contributor
Contributor
Author

Hi Martin,

Thanks for your quick reponse - makes perfect sense and worked great.

 

Regards

 

Bryan