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

Problem calculating correct percentages

I have a straight table, of trade, no of customers and sales and units.

I'm trying to calculate the % of sales and units using this expression, but getting incorrect figures for %Units and %Sales(see below)

this is the expression I'm using for %units - (Sum([Qty])/(sum([Qty - TOTAL - Present])*100))

and for %sales I'm using  (sum([Sales $]/[Sales - TOTAL - Present]))*100

example of %units

class of trade total unit/total units * 100 to get % units

eg 79,728/43856,231 * 100 = 0.182%

Do I need to put it in my script, of calculate as an expression?

      

Class of TradeNo of CustomersTotal UnitsTotal Sales% Units% Sales
AGENCY1979,728247,6431.49%2.07%
DECORATOR702,064,4814,535,47412.38%16.86%
DISTRIBUTOR9838,485,801108,168,46667.51%69.18%
MANUFACTURER352,531138,689.11%.11%
RETAIL9412,017356,427.38%.51%
WHOLESALE452,433,5734,398,9526.76%8.17%
-33328,100675,87811.36%3.09%
27743,856,231118,521,528100.00%100.00%

so confused on where I'm going wrong can someone relieve my misery.

Thanks in advance.

regards

M

1 Solution

Accepted Solutions
sunny_talwar

You were using OrderQty for your Total Units... Try this

Sum([OrderQty])/Sum(TOTAL [OrderQty])


Capture.PNG

View solution in original post

22 Replies
sunny_talwar

How about you try this

Sum([Qty])/Sum(TOTAL [Qty])

Sum([Sales $]/Sum(TOTAL [Sales $])

qlikmpate0
Creator II
Creator II
Author

Thanks Sunny this gives an incorrect % value for both units and sales

sunny_talwar

Would you be able to share a sample?

sunny_talwar

Script doesn't help... what do you get when you use this?

Sum([Qty])/Sum(TOTAL [Qty])

qlikmpate0
Creator II
Creator II
Author

Class of TradeNo of CustomersTotal UnitsTotal Sales% Units% Sales
AGENCY1979,728247,643.26%.30%
DECORATOR702,064,4814,535,4746.14%5.10%
DISTRIBUTOR9838,485,801108,168,46685.92%89.82%
MANUFACTURER352,531138,689.03%.04%
RETAIL9412,017356,4271.31%.41%
WHOLESALE452,433,5734,398,9525.29%3.53%
-33328,100675,8781.05%.79%
27743,856,231118,521,528100.00%100.00%
sunny_talwar

Can't really say what might be wrong here without looking at your dimensions, expressions and chart settings... may be someone else can help...

Best,

Sunny

shiveshsingh
Master
Master

Can you share the app ?

qlikmpate0
Creator II
Creator II
Author

I only have one dimension and that is the trade all expression attached

dimension.JPGexpression.JPG

no of customers.JPG

Total units.JPG

Total sales.JPG

percent Units.JPG

percent sales.JPG

qlikmpate0
Creator II
Creator II
Author

Sorry no because too much company info