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?
Material | Vendor | Plant | Last delivery date | PURCHASE ORDER | PURCHASE ORDER QUANTITY |
JORH321 | 00217 | 8012 | 2/20/2017 | 45496 | - |
JORH321 | 00217 | 8019 | 4/9/2015 | 45075 | 1 |
JORH321 | 00217 | 8011 | 2/18/2015 | 44195 | 2 |
JORH321 | 00217 | 8018 | 2/5/2015 | 45097 | 4 |