Skip to main content

Hi Celopeers!

 

I am trying to calculate the next activity of a specific type, ignorin all the activities between them.

 

I have tried to filter by those specific activities and then calculate ACTIVITY_LEAD, by it seems that the filter is not working properly for this KPI.

 

 

 

As an example, imagine that the activities what I am talking about are 'A', 'B' and 'C'. But also I have in my process activities '1', '2','3' AND '4'.

 

One casuistic is the following one:

 

 

 

A >> 2 >> 3 >> C >> 4 >> B

 

 

 

The metric I want to calculate is the next activity of the type A,B or C.

 

If I filter the table only by those activities, and include the formula ACTIVITY_LEAD with this filter activated, it still returns me

 

 1 

 

 

 

What I want to have is:

 

2 

 

 

Thank you so much!!

Hi @Agustín Muñoz , Can the activities A,B,C happen more than once in one case?


Hi @javier.donos ! Thanks for your answer. Yes, they can.


Hi Augustin,

 

In such case I would recommned using SOURCE()-TARGET() and a REMAP_VALUES Mapping all other values to NULL.

 

Hope this helps,

Best

Kevin


Or you can use SOURCE()-TARGET() with a filter column.


Hi Agustin,

 

Formula REMAP_VALUES allows you to change activities 1,2,3,4 into NULL and keep only the desired activities.

See below example using Target or Source with REMAP_VALUES

TARGET(

            "ACTIVITYTABLE"."ACTIVITY"

            , REMAP_VALUES("ACTIVITYTABLE"."ACTIVITY", o'1',NULL], u'2',NULL], U'3',NULL], U'4',NULL] )

)

Beware that if you are intending to do any other aggregation like CALC_THROUGHPPUT, DAYS_BETWEEN the arguments will also need to have SOURCE/TARGET as this function creates a separate virtual table.

 

Best,

Gabriel


Hi everyone!

Thanks for your answers. It was finally easier than I thought.

I realised that ACTIVITY_LEAD formula skip NULL values, so I just used a CASE WHEN statement for changing all activities that are not 'A', 'B' or 'C' to NULL, and then calculate ACTIVITY_LEAD.

 

ACTIVITY_LEAD (

CASE WHEN 

"activity_table","activity_column" IN ('A','B','C')

THEN "activity_table","activity_column" ELSE NULL END) 

 

Thanks for your help!

 

 

 

 

 

 

 

 


Reply