Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
mikeg_33
Not applicable

totals function in a table

Greetings Community,

I have a totals function that I would like to change into a KPI but the numbers are matching up when doing it.

within my measure in the table I have this:

Expression: sum(distinct completed_credits)

my table looks like this:

The blacked out employee_id is showing only one employee and the course_name is a subset of courses for that training model.

The total for the sum of completed credits only works correctly when I have employee_id and course_name within the table and if I have the Totals Function set to Sum.

can anyone give me some advise on how to change this from a table view over to a KPI? does it have something to do with the aggr() function???

Tags (2)
1 Solution

Accepted Solutions
sunny_talwar
Not applicable

Re: totals function in a table

May be try this in a KPI object

Sum(Aggr(Sum(DISTINCT completed_credits), employee_id, training_model_date, course_name))

5 Replies
sunny_talwar
Not applicable

Re: totals function in a table

May be try this in a KPI object

Sum(Aggr(Sum(DISTINCT completed_credits), employee_id, training_model_date, course_name))

mikeg_33
Not applicable

Re: totals function in a table

just tested it and it worked!

always a pleasure sunny!

mikeg_33
Not applicable

Re: totals function in a table

One more Question, if I wanted to add a set analysis based on the brand.

IE ( Jeep, Dodge, Ram, etc)  into that function would it look something like this?

Sum(Aggr(Sum(DISTINCT {<Brand = {'Jeep'}>}completed_credits), employee_id, training_model_date, course_name))

sunny_talwar
Not applicable

Re: totals function in a table

And may be add it here as well

Sum({<Brand = {'Jeep'}>} Aggr(Sum(DISTINCT {<Brand = {'Jeep'}>}completed_credits), employee_id, training_model_date, course_name))

mikeg_33
Not applicable

Re: totals function in a table

Sum({<Brand = {'Jeep'}>} Aggr(Sum(DISTINCT completed_credits), employee_id, training_model_date, course_name))

gives me the results I needed