Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
lsmith48461
Partner - Contributor
Partner - Contributor

Getting a Total Percentage

I have a chart where I want to show quantity delivered  on the due date is or isn't the same as the actual ship date. The Dimension is City. I have two expressions:

Order Qty                                      =sum(OrderQuantity)

and

Order Qty On Time                   =If(DueDate = ShipDate, sum(OrderQuantity), 0)

Everything is fine except when I add a third column for percentage.

% Order Qty On Time              =[Order Qty On Time] / [Order Qty]

The column detail naturally shows either 100% or 0%

The problem is on the Total line where nothing I have tried shows the correct percentage which should be around 85%. I've tried multiple combinations using the AGGR or TOTAL functions, but nothing seems to work.

Suggestions?

See below. 

It's either 

 

Labels (1)
10 Replies
vinieme12
Champion III
Champion III

Try below

 OrderQtyOnTime %

sum(  AGGR( If(DueDate = ShipDate, sum(OrderQuantity), 0) ,  YourChartDimension1,YourChartDimension2) )

/

sum(OrderQuantity) 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.