5 Replies Latest reply: Apr 11, 2017 12:01 PM by Michael Goldshteyn

# 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???

• ###### 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))

• ###### Re: totals function in a table

just tested it and it worked!

always a pleasure sunny!

• ###### 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))

• ###### 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))

• ###### 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