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

I want orders count that are not delivered

have orders data like this

 

Order_no     Item_no.    Eroor      Delivery_status

1011.                   1.               Null                 Delivered

1011.                   2.              Some_Error   Undelivered

1012.                   1.                NULL                Delivered

1013.                    1.            SOME_ERROR    Delivered 

 

SO HERE I WANT TO COUNT ORDERS WHERE ERROR IS NOT NULL AND UNDELIVERED , HERE I WANT THIS AT ORDER LEVEL NOT AT ITEM LEVEL . IF IN ORDER ONE ITEM NOT GOT AN ERROR MESSAGE AND DELIVERED WE CONSIDER WHOLE ORDER IS DELIVERED 

5 Replies
Vegar
MVP
MVP

Assuming that your null values are nulls (no value) and not the string 'NULL'.

Then you can try:

count({<Delivery_status={'Undelivered'},  Eroor={"*"}>}distinct Order_no)

Vinni2000
Contributor III
Contributor III
Author

We want this at order level not at at item level 

Vegar
MVP
MVP

count distinct Order_no calculate the number of unique orders, not the number of items.

Did i misunderstand your criterias? What is the expected output of the first two rows in your samplr, order 1011.? 

Vinni2000
Contributor III
Contributor III
Author

There you can see item number right for 1011 order we have two items 1, 2 and i has error and doesn't have error so count order numbers where we got some error so we should not count the order if one item from order not got error and delivered .

Vegar
MVP
MVP

I see, thats how I understood it from the beginning. Please explain what's wrong with my initial  suggested solution. Did you try it? It should, as I see it, return the output that you are asking for.