Skip to main content

Dear all,

I am encountering curious changes of results depending on the number of KPIs and Filters. I put an identifier in EKKO-VERKF for differentiating process patterns. Each pattern goes through maximum four, minimum two process flows. In other words, one CASE_ID contains from two to four activities.

Here is the problem: the result changes after you add another KPIS, namely M04 disappears, from M01 to M03 gains/loses a few. I am wondering why one KPI affects the others, or rather if I write this code wrongly.

Best regards,

[kpis]

CASE

WHEN SUBSTRING(EKKO.VERKF, 3, 3) = M01

THEN CALC_THROUGHPUT(FIRST_OCCURRENCE[a] TO FIRST_OCCURRENCE[b],

REMAP_TIMESTAMPS(ACTIVITIES.EVENTTIME, HOURS)) - 7*24

WHEN SUBSTRING(EKKO.VERKF, 3, 3) = M02

THEN CALC_THROUGHPUT(FIRST_OCCURRENCE[a] TO FIRST_OCCURRENCE[b],

REMAP_TIMESTAMPS(ACTIVITIES.EVENTTIME, HOURS)) - 14*24

WHEN SUBSTRING(EKKO.VERKF, 3, 3) = M03

THEN CALC_THROUGHPUT(FIRST_OCCURRENCE[a] TO FIRST_OCCURRENCE[b],

REMAP_TIMESTAMPS(ACTIVITIES.EVENTTIME, HOURS)) - 21*24

WHEN SUBSTRING(EKKO.VERKF, 3, 3) = M04

THEN CALC_THROUGHPUT(FIRST_OCCURRENCE[a] TO FIRST_OCCURRENCE[b],

REMAP_TIMESTAMPS(ACTIVITIES.EVENTTIME, HOURS))

ELSE 0

END

Dear Fidy,

Im not 100% sure if I understood your problem correctly. Do you mean that if you add a new WHEN condition to your CASE WHEN statement, cases that were assigned to a specific WHEN condition are now assigned to another one? E.g.; Cases that were M04 become M02 after you added another WHEN condition?

The first idea that comes to my mind, what could possibly cause this behavior, is that your WHEN conditions operates on header level, while the throughput time calculation operates on case level. Maybe this causes cases to be assigned to the wrong WHEN condition. Maybe you could try to use a PULL function to PULL the EKKO.VERKF on case level.

Best Regards


Yes, you understood me precisely: when I add new lines of codes, the result of THROUGH_PUT is absorbed by incorrect WHEN statement.
I will see on the Snap what you mention, it could be true. Thank you for your insight.

Reply