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

How Can I work out the Average days from one stage to the Next.

I am Very New to the Qlikview world, and im trying to work out that average days it takes to get to one stage to the next.

For example I need to know the average days it takes to get from [Gate 2 sign off] to the [Customer order approved]?

Any Help would be greatly appreciated.

1 Solution

Accepted Solutions
agustinbobba
Partner - Creator
Partner - Creator

Hi Lee,

The function you can use is Avg() on the expression.

Try this, I attach an example of average.

Best regards,

Agustin.

View solution in original post

5 Replies
agustinbobba
Partner - Creator
Partner - Creator

Hi Lee,

The function you can use is Avg() on the expression.

Try this, I attach an example of average.

Best regards,

Agustin.

swuehl
MVP
MVP

Since the calculation should be rather static, I would do some prework in the script (assuming a simple input data table as shown below):


Set DateFormat = 'MM/DD/YYYY';

INPUT:
LOAD * INLINE [
ID, Stage, Date
1, Init, 03/01/2016
1, Gate 2 sign off, 03/10/2016
2, Init, 03/01/2016
1, Customer order approved, 03/20/2016
2, Gate 2 sign off, 03/12/2016
2, Customer order approved, 03/18/2016
]
;

RESULT:
LOAD *,
If(ID = previous(ID), Date-previous(Date)) as Duration,
If(ID = previous(ID), previous(Stage)&'->'&Stage) as Transition
Resident INPUT
ORDER BY ID, Date;

DROP TABLE INPUT;

Then create a chart with dimension Transition and =Avg(Duration) as expression.

Hope this helps,

Stefan

lee_chandler
Contributor II
Contributor II
Author

Hi Agustin,

I can't see the attachment?

Please could you resend the example?

Kind Regards,

Lee

agustinbobba
Partner - Creator
Partner - Creator

Hi lee,

This is rare, i can see it..

2016-03-24_10-07-21.jpg

See in your thread How Can I work out the Average days from one stage to the Next.

Attached again..

Best Regards,

Agustin

lee_chandler
Contributor II
Contributor II
Author

Thank you Agustin