# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for
Did you mean:
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

 Customer C1 c2 Product Sum(Sales) % Sum(Sales) % P1 10 11.11111 12 10.43478 P2 20 22.22222 15 13.04348 P3 30 33.33333 33 28.69565 P4 10 11.11111 11 9.565217 P5 20 22.22222 44 38.26087 Total 90 115
1 Solution

Accepted Solutions
MVP

maybe you can use Total

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

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

script for test data

Transactions:

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;

Rand() as Rand1,

IterNo() as TransLineID,

RecNo() as TransID

Autogenerate 1000

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

2 Replies
MVP

maybe you can use Total

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

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

script for test data

Transactions:

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;

Rand() as Rand1,

IterNo() as TransLineID,

RecNo() as TransID

Autogenerate 1000

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

Partner

Hi avneet,

PFA

Community Browser