Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
hi this has been resolved by Jens Frederik Kristiansen
=interval(avg(aggr((sum(CHKS)-sum(SCH)),[FLT-NO],DATE)),'mm')
Tthanks for everyones assistance
Please note that you can't embed an aggregation function like sum() into another like avg() without using advanced aggregation function aggr().
So if you variable expands to something like sum(Value), this will not be a valid expression:
avg(sum(Value))
And if your variable expands to a result, i.e. a number already, there is no need to use avg().
So how have you defined your variable?
Sorry I am still getting to grips with this.
Is this the correct information you have requested?
I can't see a variable named HISTORY, so I would assume no.
it is correct sorry I changed DELAYMIN to HISTORY
Please check
http://www.qlikfix.com/2011/06/08/not-all-variables-are-created-equal/
for the difference in using an equal sign or not using one in a variable definition.
In which context do you want to use your new expression? In a chart expression? So you may want to try with creating a variable with no equal sign
Minute(frac(Timestamp1)-frac(Timestamp2))
(and please check the type of brackets you are using, I would suggest using always round brackets () with functions like frac() )
Thanks for the link.
I have amended the variable as per your advice.
I want the new expression to use the output result of HISTORY to provide the average. If there is another way I have no idea
Is anyone able to provide any additional assistance?
It would be much easier to help you if you could post a small sample app. Still too many unknowns for me to understand your issue.