Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

aggr not working in expression

Scenario: Customer satisfaction, based on job priority.

Jobs have different priorities, and customers rate their satisfaction afterwards. There are three satisfaction levels, 'Yes', 'No' and 'N/A'. There are four priorities.

I am attempting to rate percentage satisfaction against priority, rather than against all jobs (eg if there are a 17601 jobs, but only 12917 are Urgent, and of those 12917, 10487 customers were satisfied, then 81.19% is the satisfaction).

I cannot get a bar chart to do this, so I have been playing with a Straight Table chart to to see what figures come out.

If I add a calculated dimension with the formula

=aggr(count(jobID), PriorityBandDescription)
, the number I require appears against each row. If I add an expression with exactly the same formula, the number required only appears against one row for each PriorityBandDescription, with '-' against the others. This is my problem! Where am I going wrong?

I would hope the expression I require is something like

=count(JobID) /aggr(count(total JobID), PriorityBandDescription)
, but that does not work. Help!

1 Solution

Accepted Solutions
Not applicable
Author

Guten Tag Rainer!

I inserted NODISTINCT in my aggr and now that particular chart works a treat:

=count(JobID) /aggr(NODISTINCT count(JobID),PriorityBandDescription)


Vielen Dank

michael

View solution in original post

2 Replies
Not applicable
Author

Michael,

please provide a short QV example we can work with.

Thank you!

Rainer

Not applicable
Author

Guten Tag Rainer!

I inserted NODISTINCT in my aggr and now that particular chart works a treat:

=count(JobID) /aggr(NODISTINCT count(JobID),PriorityBandDescription)


Vielen Dank

michael