Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
umartareen
Creator II
Creator II

Aggregating the Values Dimension Totals Wise

Hi,

How can we calculate the Values using the totals of second dimensions :

Example :

Sum Total 2.PNG

The expression columns in the above Pivot are

Value = Sum(Value)

Sum TOTAL Value = Sum(Value) / Sum(TOTAL Value)

The above "Sum Total Value" expression is calculating as per the Total value of Employee Dimension,

Example, For State_Id 1, it would be : 100 / 3100 = 0.03

              For State_Id 2, it is : 400 / 3100 = 0.13

But what is required is that the values must be calculated as per Totals of State_Id

ie, State_Id 1 in "Sum TOTAL Value" should be 100 / 500 = 0.2

     State_Id 2 in "Sum TOTAL Value" should be be 400 / 500 = 0.8.

Also, PFA of the Test Application

Any suggestions would be greatly appreciated.

Thanks

Umar

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Sum(Value1)/Sum(TOTAL <Employee> Value1)


Capture.PNG

You basically need to tell the TOTAL qualifier about the field where you want to total on. By just using the TOTAL, it was doing the overall total. When I add <Employee>, it started doing total per Employee

View solution in original post

7 Replies
sunny_talwar

Try this:

Sum(Value1)/Sum(TOTAL <Employee> Value1)


Capture.PNG

You basically need to tell the TOTAL qualifier about the field where you want to total on. By just using the TOTAL, it was doing the overall total. When I add <Employee>, it started doing total per Employee

umartareen
Creator II
Creator II
Author

Works Perfect !

Thank You .

umartareen
Creator II
Creator II
Author

Hi,

How can this be achieved while using set expressions ?

Lets take an example :

Sum({<Year, Month>} Value1) / Sum(TOTAL {<Year, Month>} Value1)


Thanks,

Umar

sunny_talwar

This:

Sum({<Year, Month>}Value1)/Sum(TOTAL <Employee> {<Year, Month>} Value1)

umartareen
Creator II
Creator II
Author

Solved it !

Sum(<Employee> {<Year, Month>} Value1) / Sum(TOTAL <Employee> {<Year, Month>} Value1)

Regards,

Umar

sunny_talwar

umar khan wrote:

Solved it !

Sum(<Employee> {<Year, Month>} Value1) / Sum(TOTAL <Employee> {<Year, Month>} Value1)

Regards,

Umar

This isn't right, are you getting the right results? Should be this

Sum({<Year, Month>}Value1)/Sum(TOTAL <Employee> {<Year, Month>} Value1)

Without <Employee> in the numerator

davyqliks
Specialist
Specialist

This is awesome, thanks... didnt realise i could use a pivot and sub totals like this.

Nice work, thanks

 

Daniel