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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
suzel404
Creator
Creator

How can I calculate an average days ?

Hi all,

I want to calculate an average days of store which are starts the activity:

To calculcale the average days : ( count store per day for type 4,5,6 and count store per day-1 for type 4,5,6 ) / 2

My set analysis is : Count(DISTINCT {<CALENDAR_DATE={'$(=Date(Max(CALENDAR_DATE)))'} , TYPE= {4,5,6} > } STORE_ID)

But the result is only for the last date (May). How can I calculate the average day:

( Number store with type 4,5,6 per day + Number store with type 456 par day -1 )  / 2 in set analysis ?

Thanks for your help.


1 Solution

Accepted Solutions
Not applicable

sorry, the expression is:

RANGEAVG (Above (COUNT(distinct STORE_ID),0,2))

see attached file.

View solution in original post

4 Replies
Not applicable

In the Chart Table  Add the CALENDAR_month and CALENDAR_Date as dimensions and in the expression add hte following:

RANGEAVG (Above (COUNT(STORE_ID),-1,2))

This tells QView Engine to COUNT the STORE_ID (you can use DISTINCT also) and makes an average of the range between the previous row and the current row. just make sure it is sorted by ClaendarDate also. See attached file, hope this helps.

Not applicable

sorry, the expression is:

RANGEAVG (Above (COUNT(distinct STORE_ID),0,2))

see attached file.

Not applicable

Screen Shot 2014-12-27 at 20.30.15.png

Dimensions:

Month and Date

expression:  Average 

RANGEAVG (Above (COUNT(distinct STORE_ID),0,2))

expression: count

COUNT(distinct STORE_ID)

suzel404
Creator
Creator
Author

Thank you Mario.

It is exactly what I need !

Thank you very much.