Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

try this in your KPI..

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

aarkay29
Specialist
Specialist

May be this

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