Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

How can I create a count of "incorrect" work orders where a work order is incorrect if one of many fields are missing data?

I am looking to create a bar graph and KPIs that return a count of work orders that were completed incorrectly.

An "incorrect" work order would be one where the non-bulk materials are missing data in the "Removed Quantity" field. The non-bulk materials are those with no data in the Bulk Material field. There may be several materials listed on a single work order, but if any one of the non-bulk materials are missing data in that field, then I would want that to count as an incorrect work order. The correct work orders would have data in the Removed Quantity field for all of the non-bulk items associated with that work order.

For example, the rows highlighted in blue in the attached sample data would count as one incorrect work order since one of the non-bulk materials is missing data entry in the removed quantity field.

What script can I use to get a count of incorrect work orders by Main Workctr?

3 Replies
bill_markham
Not applicable

Re: How can I create a count of "incorrect" work orders where a work order is incorrect if one of many fields are missing data?

In your load script you could use the len() function to check if the length of the data in the field is greater than zero if so then set a flag of say Correct, otherwise Incorrect.

galax_allu
Not applicable

Re: How can I create a count of "incorrect" work orders where a work order is incorrect if one of many fields are missing data?

try this in your KPI..

if(len(Trim([Bulk Material]))=0 or len(Trim([Bulk Material]))=0,count(Order))

aarkay29
Not applicable

Re: How can I create a count of "incorrect" work orders where a work order is incorrect if one of many fields are missing data?

May be this

count({$-<[Bulk Material]={"*"}>*$-<[Removed Qty]={"*"}>}[Main workctr])