Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

FIRST SORTED VALUE / MAX/ SUM ISSUE

Hi,

I'm trying to calculate the total Purchase Order quantity for the last Purchase Order delivered. I used below expression to give me my results which does return values. However, I need to add a sum function inside of this expression in order to get the total quantity as each purchase order can have multiple lines for the same material. Also, I am receiving null values in my results which could be due to multiple last delivery dates for a material.

=(FirstSortedValue([PO_QUANTITY],-Aggr(max({<PurchaseOrders.DELETED = {' '}>}DELIVERYDATE),[PurchaseOrder],[PO_QUANTITY])))

The dimensions for my chart are Material,Vendor,Plant

Here is a sample of my results; I missing a purchase order quantity for delivery date 02/20/2017. It's supposed to be 41. I looked at the data inside my application and saw that there were multiple Purchase orders with delivery dates of 02/20/2017 which could be confusing Qlikview into deciding which Purchase order to use. Please advise if there are any solutions to this?

     

MaterialVendorPlantLast delivery datePURCHASE ORDERPURCHASE ORDER QUANTITY
JORH3210021780122/20/201745496-
JORH3210021780194/9/2015450751
JORH3210021780112/18/2015441952
JORH3210021780182/5/2015450974
0 Replies