Skip to main content
Hi all,
We have implemented a new system, which has different activities names.
I would like to have one graph, where the graph shows the data from one activity, and after a certain date (01-09-2019 (dd-mm-yyyy)) from an other activity.
Using now the following formula in two different graphs, but I would like to combine them.
AVG(CALC_THROUGHPUT(FIRST_OCCURRENCE[Ontvang Factuur] TO LAST_OCCURRENCE[Valideren Factuur], REMAP_TIMESTAMPS(XXCEL_AP_ACTIVITIES.EVENTTIME, HOURS)))
AVG(CALC_THROUGHPUT(FIRST_OCCURRENCE[XXAIMG: Ontvangen in APRO Imaging] TO LAST_OCCURRENCE[Valideren Factuur], REMAP_TIMESTAMPS(XXCEL_AP_ACTIVITIES.EVENTTIME, HOURS)))
Is this possible?
Hope you can help me.
Kind regards,
Jelmer
Hi Jelmer,
If I understand you correctly then 01-09-2019 is the day you swapped to a new system, so, all new cases starting after that day will use the new names? The way to merge the formulas is to use a case when statement.
Heres my suggestion for the formula

AVG( CASE WHEN DAYS_BETWEEN(PU_FIRST(YOUR CASE TABLE,XXCEL_AP_ACTIVITIES.EVENTTIME), TO_TIMESTAMP(01-09-2019, DD-MM-YYYY)) > 0

THEN CALC_THROUGHPUT(FIRST_OCCURRENCE[ Ontvang Factuur ] TO LAST_OCCURRENCE[Valideren Factuur], REMAP_TIMESTAMPS(XXCEL_AP_ACTIVITIES.EVENTTIME, HOURS))
ELSE
CALC_THROUGHPUT(FIRST_OCCURRENCE[ XXAIMG: Ontvangen in APRO Imaging ] TO LAST_OCCURRENCE[Valideren Factuur], REMAP_TIMESTAMPS(XXCEL_AP_ACTIVITIES.EVENTTIME, HOURS))
END)
DAYS_BETWEEN() returns a negative number if the second date argument takes place before the first. So by testing DAYS_BETWEEN(PU_FIRST(CASE TABLE,XXCEL_AP_ACTIVITIES.EVENTTIME), TO_TIMESTAMP(01-09-2019, DD-MM-YYYY)) > 0, all the cases for which there first activity takes place before the cut off are using the old activity name and all cases that start after it use the new name.
Does this solve your problem? Is there anything else we can help you with?
Best wishes,
Calandra
Dear Calandra,
This works perfectly! Thank you very much!
Kind regards,
Jelmer

Reply