Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone! I need your help!
I have to calculate the number of orders with errors. An error ocurrs when the quantity of Items ordered is different from the quantity of items shipped.
I have the fields: Order ID, Shipment ID and Product ID
and calculated measures:( in master items):
Quantity of Items ordered( ((COUNT([ProductID]))/COUNT(DISTINCT(OrderID))
Quantity of Items Shipped ((COUNT([ProductID]))/COUNT(DISTINCT(ShipmentID))
Numbers of different Orders ( Count(Distinct(OrderID)
How can I calculate the number different orders with errors?
Thank you very much for your help.
Maybe Count({<OrderID={"=Count(ProductID)<>Count(ShipmentID)"}>}Distinct OrderID).
But this assumes that:
If these assumptions are not correct then you need to provide more information. In that case please post a small qlikview document that illustrates the problem.
Hello Gysbert! Thank you very much for your help. It works perfectly this way:
Count({<OrderID={"=(COUNT([ProductID]))/COUNT(DISTINCT(OrderID))<>(COUNT([ProductID]))/COUNT(DISTINCT(ShipmentID))"}>}Distinct OrderID)
I had to make some chances because I have multiple items in each order and shipment.
Again, thank you very much,
Hi,
Try like this
=Sum(Aggr(If(Sum(OrderedItems) <> Sum(ItemsShipped), 1, 0), OrderID))
OR
Count({<OrderID={"=Sum(OrderedItems)<>Sum(ItemsShipped)"}>}Distinct OrderID)
Hope this helps you.
Regards,
Jagan.