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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
JHoltrop
Contributor
Contributor

Summing measures per dimensions in table

Hi all,

I have a problem with showing data into a table within Qlik Sense.

I have two measures (Measure_a, Measure_b) with two dimensions (employee, week).

My goal is to get the total absolute value of Measure_a - Measure_b of all employees over all weeks.

Currently I have a master item "Delta" which says : fabs(Measure_a - Measure_b)

However, when inspecting the results it shows the sum of all Measure_a - Measure_b and then takes the absolute value of that number. But I want it to take the absolute of (Measure_a - Measure_b) of each Employee of each week and then sum it. 

Labels (1)
1 Solution

Accepted Solutions
brunobertels
Master
Master

hi 

may be this 

But I want it to take the absolute of (Measure_a - Measure_b) of each Employee of each week and then sum it. 

 

sum(

aggr(

fabs(Measure_a - Measure_b) ,Employee ,week )) 

)

 

Or 

fabs(

Sum(

aggr( Measure_a ,Employee ,week

)

-

Sum(

aggr( Measure_b ,Employee ,week ) 

)

)

View solution in original post

2 Replies
brunobertels
Master
Master

hi 

may be this 

But I want it to take the absolute of (Measure_a - Measure_b) of each Employee of each week and then sum it. 

 

sum(

aggr(

fabs(Measure_a - Measure_b) ,Employee ,week )) 

)

 

Or 

fabs(

Sum(

aggr( Measure_a ,Employee ,week

)

-

Sum(

aggr( Measure_b ,Employee ,week ) 

)

)

JHoltrop
Contributor
Contributor
Author

Yes the first one did it! Thank you very much!