Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
mohan_1105
Partner - Creator III
Partner - Creator III

How to find the Average Interval between Days?

Hi,

I wanted to calculate the average interval days between consecutive dates. I found the interval using the following expression,

Interval(Below(date(ORDERDATE)) - date(ORDERDATE),'d')

I tried using the following expression, Aggr(Avg(Interval(Below(date(ORDERDATE)) - date(ORDERDATE),'d')))

it throws me an error in expression saying Below function is not allowed inside aggregation.

I am actually trying to get the table like,

Capture.JPG

I have attached the sample file for your convenience.

Thanks in advance!!

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Avg(total <Group> Aggr(

Interval(Below(ORDERDATE)-ORDERDATE-1,'D')

,Group,ORDERDATE))

View solution in original post

2 Replies
tresesco
MVP
MVP

Try like:

Avg(total <Group> Aggr(

Interval(Below(ORDERDATE)-ORDERDATE-1,'D')

,Group,ORDERDATE))

mohan_1105
Partner - Creator III
Partner - Creator III
Author

Hi Tresesco,


Thanks for helping me with the expression. It works for good.