Both the functions are used to retrieve rework, what is the difference ?
Hi @Raman Silotia
you are right that both can be used to calculate KPIs related to rework, but the actual functions do different things.
The main difference is that CALC_REWORK calculates "rework" on Case-Level. Just using CALC_REWORK() just returns the number of Activities per case (which, I agree, is not really rework), but when you pass a filter condition to select a specific activity (e.g., CALC_REWORK("Activities"."Activity" = 'X') ), then it will return the number of times this activity occurs per case (i.e., how often it was reworked).
INDEX_ACTIVITY_TYPE, however, returns the result not on Case-level, but on Activity level. For each row in the Activity table, it returns how often this Activity has already occurred in that case so far.
So filtering on a specific Activity, and calculating the maximum INDEX_ACTIVITY_TYPE value per Case would give you the same result as the CALC_REWORK would return for this Activity.
For more information on both functions, including examples and syntax descriptions, please have a look at the documentation pages: https://docs.celonis.com/en/calc_rework.html, https://docs.celonis.com/en/index_activity_type.html
Let me know if you have more questions about these functions.
Best
David
Hi @Raman Silotia
you are right that both can be used to calculate KPIs related to rework, but the actual functions do different things.
The main difference is that CALC_REWORK calculates "rework" on Case-Level. Just using CALC_REWORK() just returns the number of Activities per case (which, I agree, is not really rework), but when you pass a filter condition to select a specific activity (e.g., CALC_REWORK("Activities"."Activity" = 'X') ), then it will return the number of times this activity occurs per case (i.e., how often it was reworked).
INDEX_ACTIVITY_TYPE, however, returns the result not on Case-level, but on Activity level. For each row in the Activity table, it returns how often this Activity has already occurred in that case so far.
So filtering on a specific Activity, and calculating the maximum INDEX_ACTIVITY_TYPE value per Case would give you the same result as the CALC_REWORK would return for this Activity.
For more information on both functions, including examples and syntax descriptions, please have a look at the documentation pages: https://docs.celonis.com/en/calc_rework.html, https://docs.celonis.com/en/index_activity_type.html
Let me know if you have more questions about these functions.
Best
David
So can I say that if I want to calculate rework rate of all activities I should go for INDEX_ACTIVITY_TYPE, but for a specific set of activities I should use CALC_REWORK ?
So can I say that if I want to calculate rework rate of all activities I should go for INDEX_ACTIVITY_TYPE, but for a specific set of activities I should use CALC_REWORK ?
That is true, yes!
So can I say that if I want to calculate rework rate of all activities I should go for INDEX_ACTIVITY_TYPE, but for a specific set of activities I should use CALC_REWORK ?
Ok thanks David :)
@david.beche12 Do you know how to aggregate this on Case-Level to calculate the rework rate? For me the rework rate are all the cases which have 1 acctivity which occurs twice if I use the function INDEX_ACTIVITY_TYPE. Now the difficulty for me is to aggregate this on case level and give it out as a number.
Thank you in advance if you have an answer for this!
You can use a PU function for this. For example, you could use a PU_MAX on the INDEX_ACTIVITY_TYPE result and if that is >1, you have a rework case.
CASE WHEN PU_MAX( CASE_TABLE(), INDEX_ACTIVITY_TYPE( ACTIVITY_COLUMN() ) ) > 1 THEN 1 ELSE 0 END
This would return a 1 if the case is a rework case, and a 0 otherwise.
Best
David
You can use a PU function for this. For example, you could use a PU_MAX on the INDEX_ACTIVITY_TYPE result and if that is >1, you have a rework case.
CASE WHEN PU_MAX( CASE_TABLE(), INDEX_ACTIVITY_TYPE( ACTIVITY_COLUMN() ) ) > 1 THEN 1 ELSE 0 END
This would return a 1 if the case is a rework case, and a 0 otherwise.
Best
David
Thank you for your help! I will study PU_Functions a bit more now
Hey David,
first of all thanks for your explanations... I used them to fix my problem, but if I use INDEX it shows me just 3 Activities with Rework (which ones I can controll in the Variant explorer that have Rework on them self) and in the CALC_REWORK functions it shows me 100% in every Activity...
In the picture below you see I want to analyse all Activities. So I take the Activities as the Dimension and Acitivity count as KPI. Furthermore I would like to show how many Activities where real "Rework" and how often did they appear.
best regards
Arthur
Hey David,
first of all thanks for your explanations... I used them to fix my problem, but if I use INDEX it shows me just 3 Activities with Rework (which ones I can controll in the Variant explorer that have Rework on them self) and in the CALC_REWORK functions it shows me 100% in every Activity...
In the picture below you see I want to analyse all Activities. So I take the Activities as the Dimension and Acitivity count as KPI. Furthermore I would like to show how many Activities where real "Rework" and how often did they appear.
best regards
Arthur
Hi Arthur,
what do you mean by "real Rework"? Would you like to count the total number of occurrences of the activity but without counting when the activity occurs the first time in a case? In that case you can just count all occurrences where the INDEX_ACTIVITY_TYPE is >1:
COUNT(CASE WHEN INDEX_ACTIVITY_TYPE( ACTIVITY_COLUMN() ) > 1 THEN 1 ELSE NULL END)
Can you maybe elaborate more on the "how often did thy appear" question? Would you like to know how often each activity occurs on average per case?
Best
David
Hi David,
thanks a lot for your help! I used your function in my case but it gives me the same numbers as the "activity count" function (see picture 1 below)
The second picture shows an overview about my talbes which I need for my analysis. There you see the last table (on the button) where i don´t know how to calculate the activities which accours more then one times in a case (rework).
In this table i want to sum the activities count of the activities which accours more then one times in a case (which stands for rework, right?)
(I hope you understand what I mean)
Picture 1
Picture 2
Hi David,
thanks a lot for your help! I used your function in my case but it gives me the same numbers as the "activity count" function (see picture 1 below)
The second picture shows an overview about my talbes which I need for my analysis. There you see the last table (on the button) where i don´t know how to calculate the activities which accours more then one times in a case (rework).
In this table i want to sum the activities count of the activities which accours more then one times in a case (which stands for rework, right?)
(I hope you understand what I mean)
Picture 1
Picture 2
Hi Arthur,
it should not return the same values as the Activities count. Can you maybe post the exact PQL that you are using to create "Picture 1"? Do you have any filters applied?
Best
David
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.