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: 
Not applicable

Avg function throwing an error

Hello,

I have an expression like this which works correctly.

Interval(if(len(Max(END_DATE))=0,Today(),Max(END_DATE))-Min(START_DATE),'dd')

But When i tried to do an average of it, it says Error in Expression.

Avg(Interval(if(len(Max(END_DATE))=0,Today(),Max(END_DATE))-Min(START_DATE),'dd'))

Could anyone understand the mistake in this? START_DATE and END_DATE are timestamps.

Thanks

Ramakanth

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You are embedding max() aggregation function into another aggregation function, avg(), which is not possible without using advanced aggregation aggr() function.

View solution in original post

1 Reply
swuehl
MVP
MVP

You are embedding max() aggregation function into another aggregation function, avg(), which is not possible without using advanced aggregation aggr() function.