Count number of times 2 actions appear in same transaction

In my sample data I have 4 calls processed. The second and last call disconnects before the transfer is complete and shows TRANSFER followed by END.
I want to count how many times TRANSFER and END occur together in an Identifier.
Thank you for your help.

|Sequence|Identifier|Action|

|80522675|3138675309|START|
|80522676|3138675309|MAIN GREETING|
|80522677|3138675309|MENU|
|80522678|3138675309|SELECT|
|80522679|3138675309|MESSAGE|
|80522680|3138675309|TRANSFER|

|80522681|2123655555|START|
|80522682|2123655555|MAIN GREETING|
|80522683|2123655555|MENU|
|80522684|2123655555|SELECT|
|80522685|2123655555|MESSAGE|
|80522686|2123655555*|TRANSFER|*
|80522687|2123655555*|END|*

|80522688|7276551234|START|
|80522689|7276551234|MAIN GREETING|
|80522690|7276551234|MENU|
|80522691|7276551234|SELECT|
|80522692|7276551234|MESSAGE|
|80522693|7276551234|END|

|80522694|4329871560|START|
|80522695|4329871560|MAIN GREETING|
|80522696|4329871560|MENU|
|80522697|4329871560|SELECT|
|80522698|4329871560|MESSAGE|
|80522699|4329871560*|TRANSFER|*
|80522700|4329871560*|END|*

Hi Stapper,

I want to understand more on how this call data is being stored in your dataset. Is each call being represented as one row?

You can look into contains function to define the above logic
i.e. ifelse(contains({column_name}, ‘TRANSFER’) AND contains({column_name}, ‘END’), ‘output_name’, null)

1 Like

Thanks imaitri,
I will look at the “contains” and see if I can make it work.
Each call is represented by the “Idenitifier” and I added an empty line to show each call in this example. The empty line does not exist in the real file.
Thanks for your assistance, I appreciate it.