Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
manjunaths
Contributor II
Contributor II

Expression for average TAT(turn around time) calculation

Hi,

I hope someone can help me with this.

I have below scenarios. With this I want to calculate TAT(Turn around Time) for each scenario. I want to create a report for this TAT calculation.

Scenario id s_seq s_date r_seq r_date
1 c1 1 1-10-2022 1 4-10-2022
2 c1 2 6-10-2022 2 8-10-2022
3 c1 3 11-10-2022 3 15-10-2022
4 c1 4 19-10-2022    

 

I need output as below.(report selection is based on max(s_date))

* if i select date range between 1-10-2022 and 5-10-2022 then scenario 1 should not appear in the report.(report should not show any records)

*if i select date range between 1-10-2022 and 10-10-2022 then report output should be as below

id max_s_date max_r_date count of id Average TAT(latest s_date – previous r_date)
c1 6-10-2022 8-10-2022 1 2

 

*if i select date range between 1-10-2022 and 18-10-2022 then report output should be as below

id max_s_date max_r_date count of id Average TAT(latest s_date – previous r_date)
c1 11-10-2022 15-10-2022 1 3

 

*if i select date range between 1-10-2022 and 19-10-2022 then report output should be as below

id max_s_date max_r_date count of id Average TAT(latest s_date – previous r_date)
c1 19-10-2022 15-10-2022 1 3

 

To get the above outputs, I need two expressions.

1. Count of IDs

2. Avergae TAT( max_s_date-max_r_date)

 

 

2 Replies
manjunaths
Contributor II
Contributor II
Author

adding more information to the above question...

I have created a variable as below.

vTest=max_s_date-(if (max_r_date>max_s_date, max(prev_r_date), max_r_date))

Used this variable in the below Set Analysis to calculate TAT.

Avg({<[max_s_date]={">=$(=$(vNumSF)) <=$(=$(vNumST))"}>} $(vTest))

here $(vNumSF) and $(vNumST) are date selection variables.

Kindly anyone help?  if above analysis is correct or not..

manjunaths
Contributor II
Contributor II
Author

can anyone reply for this?