Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
New-Qlik
Creator II
Creator II

how to calculate % sales

Hello everyone,

I have two dimensions

1. Product

2. Customer

measure is sales

I want to get sum(sales) and % 

so percentage of sales for c1 and p1 is (10/90)*100

      

CustomerC1c2
ProductSum(Sales)%Sum(Sales)%
P11011.111111210.43478
P22022.222221513.04348
P33033.333333328.69565
P41011.11111119.565217
P52022.222224438.26087
Total90 115
1 Solution

Accepted Solutions
maxgro
MVP
MVP

maybe you can use Total


sum(Sales) / sum(TOTAL <Customer> Sales)



EDIT: added an example with test data in a pivot chart

1.png

script for test data


Transactions:

Load

TransLineID,

TransID,

mod(TransID,26)+1 as Num,

Pick(Ceil(3*Rand1),'A','B','C') as Customer,

Pick(Ceil(6*Rand1),'a','b','c','d','e','f') as Product

Round(1000*Rand()*Rand()*Rand1) as Sales;

Load

Rand() as Rand1,

IterNo() as TransLineID,

RecNo() as TransID

Autogenerate 1000

While Rand()<=0.5 or IterNo()=1;

View solution in original post

2 Replies
maxgro
MVP
MVP

maybe you can use Total


sum(Sales) / sum(TOTAL <Customer> Sales)



EDIT: added an example with test data in a pivot chart

1.png

script for test data


Transactions:

Load

TransLineID,

TransID,

mod(TransID,26)+1 as Num,

Pick(Ceil(3*Rand1),'A','B','C') as Customer,

Pick(Ceil(6*Rand1),'a','b','c','d','e','f') as Product

Round(1000*Rand()*Rand()*Rand1) as Sales;

Load

Rand() as Rand1,

IterNo() as TransLineID,

RecNo() as TransID

Autogenerate 1000

While Rand()<=0.5 or IterNo()=1;

raju_insights
Partner - Creator III
Partner - Creator III

Hi avneet,

PFA

Qlik Community.JPG