Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mb_me
Contributor II
Contributor II

Help developing a Qlik expression for transaction communication data

Hey everyone, I'm at wits end with this problem. Any help is greatly appreciated!


Scenario:
- Determine average response time from customer -> support agent, and average response time from support agent -> customer, for each case id in the dataset. 

Dataset example:

Case id case creation date transaction type code transaction name transaction date transaction timestamp (hh:mm:ss)
1 11/15/2024 1 Customer submission 11/15/2024 06:32:30
1 11/15/2024 5 support provides solution 11/15/2024 07:15:20
1 11/15/2024 2 customer denies solution 11/15/2024 07:25:15
1 11/15/2024 5 support provides solution 11/15/2024 07:35:10
1 11/15/2024 2 customer denies solution 11/15/2024 08:15:18
1 11/15/2024 5 support provides solution 11/15/2024 08:32:53
1 11/15/2024 3 customer accepts solution 11/15/2024 08:45:32
1 11/15/2024 8 support closes case 11/15/2024 09:18:36

 

So support response times would look at the time difference between message types 5 or 8 (support replies), and 1, 2, or 3 (customer questions). 
Customer response times would look at the time difference between message types 2 or 3 (customer replies), and 5 (support answers).

Has anyone had experience answering a similar problem in their work?

Note: I don't have developer rights for the app that provides this dataset, so I am stuck using the Qlik expression editor.

Labels (1)
1 Reply
Qrishna
Master
Master

Usually we need a sorting field for this kind of problems, as you said you dont have access to load editor, you can try below, but make sure the order is always that shown in th table above (Ascending Time sort like above):

Interval(Aggr(if(RowNo(total) = 1
, 0
, if(RowNo(total) <> 1 and [Case id] = above([Case id]) and Subfield(Capitalize([transaction name]), ' ', 1) <> Above(Subfield(Capitalize([transaction name]), ' ', 1))
, [transaction timestamp (hh:mm:ss)] - Above([transaction timestamp (hh:mm:ss)])
, 0
)
)
, [transaction timestamp (hh:mm:ss)])
, 'hh:mm:ss')

2493773 - Expression for transaction communication data.PNG