Skip to main content
Suppose I am using PU_AVG function to calculate time between ticket deferred and ticket released activity for each case but in my scenario there are multiple combinations of ticket deferred and ticket released so, will it pick all occurance per case or not.
Hi @Abhitndn
That depends on how you calculate the times, and at which point you apply the PU_AVG.
In general, the PU_AVG (like all PU functions) takes all values per case into account which are not null and which fulfill the filter condition of the PU function.
You can take a look at the documentation of the PU functions to learn more about this behavior.
Best
David
Thanks for your response David. My code is
(PU_AVG("_CEL_ITSM_CASES", REMAP_TIMESTAMPS("_CEL_ITSM_ACTIVITIES".EVENTTIME, HOURS)*1.0,
CEL_ITSM_ACTIVITIES"."ACTIVITY<%=language%> = Ticket Released )
-PU_AVG("_CEL_ITSM_CASES", REMAP_TIMESTAMPS("_CEL_ITSM_ACTIVITIES".EVENTTIME, HOURS)*1.0,
CEL_ITSM_ACTIVITIES"."ACTIVITY<%=language%> = Ticket Deferred ))
and we have multiple combinations of Ticket Released and Ticket Deferred so will this take average of all occurances or any specific one.
Hi @Abhitndn
this will take the average timestamp of all Ticket Released activities, and subtract the average timestamp of all Ticket Deferred activities.
The question is if that is what you actually want. If you want to calculate the average time between Ticket Deferred and Ticket Released activities, you might want to use SOURCE and TARGET functions inside the PU_AVG. With SOURCE and TARGET, you can calculate the throughput times between the two activities for each case before applying the average.
So you probably want to do something like this:
PU_AVG(
"_CEL_ITSM_CASES",
HOURS_BETWEEN( SOURCE( "_CEL_ITSM_ACTIVITIES"."EVENTTIME", REMAP_VALUES("_CEL_ITSM_ACTIVITIES"."ACTIVITY_EN", ['Ticket Released', ''], ['Ticket Deferred', ''], null) ), TARGET( "_CEL_ITSM_ACTIVITIES"."EVENTTIME") ),
SOURCE( "_CEL_ITSM_ACTIVITIES"."EVENTTIME") = 'Ticket Deferred'
)

This will also not take the time between Ticket Released Ticket Deferred into account, but only the Ticket Deferred Ticket Released edges.
For more information about SOURCE and TARGET, please take a look at the corresponding documentation.
Thanks and BR
David
Thanks, David I think it solves my issue. The only doubt that remains is if there are multiple occurrences of ticket deferred ticket released in one case will it include all occurrences and will it neglect activities between these pair as well if deferred and released are not directly followed eg (ticket deferred-> X Y ticket released)
Yes, it will take all pairs inside one case into account, and it will ignore activities between the two activities.
Example (one case):
Ticket Deferred
X
Y
Ticket Released
A
Ticket Deferred
Ticket Released
Here it would take the time between the first Ticket Deferred and the first Ticket Released, as well as the time between the second Ticket Deferred and the second Ticket Released.
You can test this if you filter on a single case and check if the value of the result matches the expected result.
Best
David
Thanks, David for your help that worked perfectly.

Reply