Skip to main content
Question

Single KPI - I want to count WIP cases that their latest event matches a specific activity

  • February 3, 2023
  • 1 reply
  • 1 view

Forum|alt.badge.img

essentially i want to bucket cases based on where their latest event is.

 

what would be the best PQL clause to use in this instance?

1 reply

abhishek.chatu14
Level 11
Forum|alt.badge.img+4

You can try the following syntax for the same

 

SUM(CASE WHEN PU_LAST(CASE_TABLE,ACTIVITY_TABLE.EVENTIME= 'specific activity' ) THEN 1 END )

 

This expression counts the number of times the value 'specific activity' appears in the CASE_TABLE

where the condition ACTIVITY_TABLE.EVENTIME= 'specific activity' is true. It uses the PU_LAST function to get the value of the EVENTIME column for the last row satisfying the condition, and the SUM functions to count the number of times this value is equal to 'specific activity'.