Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 |
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:
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;
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:
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;
Hi avneet,
PFA