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

Calculate the Average of a pre defined variable

I have defined a variable which performs a calculation.

I then want a seperate field to calculate the average of the output of the variable,

I tried using Avg($(HISTORY))

but to no avail

13 Replies
Not applicable
Author

I have attached an example of the data I am working with.

I am trying to find the average of Delay Mins, which has the variable HISTORY.

and I am then going to try and count the data with delay mins of +15

Not applicable
Author

hi this has been resolved by Jens Frederik Kristiansen

=interval(avg(aggr((sum(CHKS)-sum(SCH)),[FLT-NO],DATE)),'mm')

Tthanks for everyones assistance

swuehl
MVP
MVP

Good to hear that this is finally solved.

If you are using the expression in a table chart (like in your sample file), you probably don't need the advanced aggregation, this should get you the same result (in your table Avg Delay Mins):

=interval(avg(CHKS-SCH),'mm')

Not applicable
Author

Hi Swuehl,

Thanks for the info I have added an additional column to compare the results and you are correct it populates the same output thank you.