Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
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
Highlighted

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.

Highlighted
galax_allu
Valued Contributor

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))

Highlighted
aarkay29
Valued Contributor

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])