Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate number of orders with errors in qlik sense

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.

3 Replies
Gysbert_Wassenaar

Maybe Count({<OrderID={"=Count(ProductID)<>Count(ShipmentID)"}>}Distinct OrderID).

But this assumes that:

  • Only one unit of a product is ordered per order
  • In a single shipment only one product per order is shipped.

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.


talk is cheap, supply exceeds demand
Not applicable
Author

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,

jagan
Luminary Alumni
Luminary Alumni

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.