Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

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

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


Capture.PNG

View solution in original post

22 Replies
Highlighted

How about you try this

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

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

Highlighted
Creator II
Creator II

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

Highlighted

Would you be able to share a sample?

Highlighted

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

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

Highlighted
Creator II
Creator II

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%
Highlighted

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

Highlighted
Master
Master

Can you share the app ?

Highlighted
Creator II
Creator II

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

Highlighted
Creator II
Creator II

Sorry no because too much company info