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

Percentage calc

Hi Experts,

I want to get the Percentage of sales made by Dim1, Dim2 or Dim3.

I am not sure how to write the expression to achieve this.

I have straight table with below dimensions and expressions

Dimensions:

Dim1

cyclicgroup contain-Dim2 & Dim3

Expression:

sum(sales)

I have created the app with sample data.. please help..

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

sum(Sales)  / sum( TOTAL Sales)   ...will give you the % of total.

Try removing the 1st dimension and adding dim1 to the cycle. The new expresison will give you a % of total for any dim you select in the cycle group.

View solution in original post

9 Replies
JonnyPoole
Employee
Employee

sum(Sales)  / sum( TOTAL Sales)   ...will give you the % of total.

Try removing the 1st dimension and adding dim1 to the cycle. The new expresison will give you a % of total for any dim you select in the cycle group.

MK_QSL
MVP
MVP

Use two Expressions

1)     sum(Sales)

2)     sum(Sales) ..... Tick Relative option...in expression tab

rustyfishbones
Master II
Master II

Do as both guys said

surajap123
Creator II
Creator II
Author

Thanks for all the suggestions..

Dim1 is the main category, so i want it to be always present in the chart and want to switch between Dim2 and Dim3.

I have updated the data in the app. Please help me with the solution.

MK_QSL
MVP
MVP

Still you can use my solution....

Create Two Expressions

1) SUM(sales)

2) SUM(sales) ...Tick Relative option in Expression Tab

maleksafa
Specialist
Specialist

use the relative box under the expression tab, the easiest way for straight forward percentage calculation.

Not applicable

Suraj,

You should be able to do this with the calculation of:

(Sales) / sum(total Sales)

I attached a workbook for you.  QlikView recalculates the sum(sales) when you change dimensions in the group, so, your % total will change accordingly.

JonnyPoole
Employee
Employee

Would you like the Dim2 or Dim3 values to be a % of grand total or a %subtotal of Dim1 ?

Both options below.  For the subtotal , use:   sum(   Sales) / sum(total <Dim1> Sales)

Percent-test1.PNG.png

surajap123
Creator II
Creator II
Author

Thanks everyone for the great help