Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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)
We want this at order level not at at item level
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.?
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 .
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.