Need HELP: KPI for Touchless or Manual Intervention or Unknown

Hello

I am trying to create a KPI called “PO Touch Indicator” that will allow me to have a Value of ‘touchless’, ‘manual intervention’, or ‘unknown’ based on the activites and User Type per PO.

When AT LEAST one UserType = ‘-’ then ‘unknown’
When ALL UserType = ‘B’ then Touchless
When AT LEAST one UserType = ‘A’ and rest are ‘B’ or all are ‘A’ then Manual intervention

Ex 1:
PO: 12344232 // PO ITEM: 01 // Activity: 1 // UserType: A // KPI "PO Touch Indicator: ‘unknown’
PO: 12344232 // PO ITEM: 01 // Activity: 2 // UserType: - // KPI "PO Touch Indicator: ‘unknown’
PO: 12344232 // PO ITEM: 01 // Activity: 3 // UserType: B // KPI "PO Touch Indicator: ‘unknown’

Ex 2:
PO: 12344232 // PO ITEM: 01 // Activity: 1 // UserType: B // KPI "PO Touch Indicator: ‘touchless’
PO: 12344232 // PO ITEM: 01 // Activity: 2 // UserType: B // KPI "PO Touch Indicator: ‘touchless’
PO: 12344232 // PO ITEM: 01 // Activity: 3 // UserType: B // KPI "PO Touch Indicator: ‘touchless’

Ex 3:
PO: 12344232 // PO ITEM: 01 // Activity: 1 // UserType: A // KPI "PO Touch Indicator: ‘manual intervention’
PO: 12344232 // PO ITEM: 01 // Activity: 2 // UserType: A // KPI "PO Touch Indicator: ‘manual intervention’
PO: 12344232 // PO ITEM: 01 // Activity: 3 // UserType: B // KPI "PO Touch Indicator: '‘manual intervention’

Hello Neel,

This is best solved by a Case When Statement. I think the shortest way would be to Count the Distinct User Types on Case Level. If it’s 1 User Type and that User is B then its touchless, if the Count of ‘-’ Users is greater than 0 its unknown and all the rest would be manual intervention.

Best regards,

Benedict

Hi Bene

Thank you for your advise

can you please give me an example this CASE WHEN statement ? I’m not too sure how to write this formula

thank you !

Hey Neel,

In order to calculate something from the activity table on case level, one has to use PU_Functions. Please see our PQL-Reference for more Information on them.

Something like this should work:

CASE
WHEN PU_COUNT_DISTINCT(“YourCaseTable”, “YourActivityTable”.“USERTYPE”) = 1 AND PU_LAST(“YourCaseTable”, “YourActivityTable”.“USERTYPE”) = ‘B’
THEN ‘Touchless’
WHEN PU_COUNT(“YourCaseTable”, “YourActivityTable”.“USERTYPE”, “YourActivityTable”.“USERTYPE” = ‘-’) > 0
THEN ‘Unknown’
ELSE ‘Manual Intervention’
END

Best Regards,

Bene