Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

dino_ferrarini
New Contributor II

All items deliverd Calculated Field for Sales Orders

Hello Community!

I need to create a Calculated Field to indicate if All items from a Sales Order has been delivered or not. In case one Line is not yet delivered for the associated Sales order, the Calculatef Fild should indicate 'No' for all items or Yes in the opposite case. I have more than 40k lines but I show you an example. This is what I have.

Capture1.PNG

When applied the script on the calculated field it should look like this:

Capture1.PNG

I cpouldn´t solve it. And I need this fild for the further calculations.

Thanks in advance!

1 Reply
MVP
MVP

Re: All items deliverd Calculated Field for Sales Orders

If you make sure that items that have no delivery date yet is Null then this additional table would by association give the additional field for you:

DELIVERED:

LOAD

   [Sales Order],

   If( Count( [Sales Order] ) = Count( [Delivery Date]) , 'Yes','No') AS [All Items Delivered]

RESIDENT

  SALES_ORDERS

GROUP BY

[Sales Order];

If you need this field merged into the SALES_ORDERS table you can JOIN it:

SALES_ORDERS:

........

;

JOIN

LOAD

   [Sales Order],

   If( Count( [Sales Order] ) = Count( [Delivery Date]) , 'Yes','No') AS [All Items Delivered]

RESIDENT

  SALES_ORDERS

GROUP BY

[Sales Order];