Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I currently have an expression taking the sum of all weeks in the set "WeekofYear". I want to rewrite this expression to take the average of all weeks in the quarter except the most current week which is defined by the variable $(vMaxWeek).
Avg
({<[Source Type]={'RACE_REV_EST'}, [WeekOfYear] >}NAT_AMT) / $(vScaleM)
Try:
Avg
({<[Source Type]={'RACE_REV_EST'}, [WeekOfYear] ={"<>$(vMaxWeek)"} >}-{<>} NAT_AMT) / $(vScaleM)
Hope this helps,
Jason
Hi Jason,
Thanks for your help. I tried your expression but it's not producing a number. QlikView is having problems with the last part of the expression.
{<>} NAT_AMT) /
$(vScaleM)
Oops! Sorry - I meant to remove that...
Avg
({<[Source Type]={'RACE_REV_EST'}, [WeekOfYear] ={"<>$(vMaxWeek)"} >} NAT_AMT) / $(vScaleM)
Still no cigar. What if we tried to produce the average without trying to subtract out the most current week ($(vMaxWeek)) from the calculation. Would that be easier to write?
Can you post your app please? Would be much easier to help then.
Avg({<[Source Type]={"RACE_REV_EST"}, [WeekOfYear] ={"=WeekOfYear<>$(vMaxWeek)"} >} NAT_AMT) / $(vScaleM)
And the syntax $(vMaxWeek) depends on what is stored in this variable (expression with or without =).