Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
fmazzarelli
Partner - Creator III
Partner - Creator III

average of total anticipated

Hi Community,

how could I make the average of a total (automatically calculated)?

See image attachedImmagine.png

2 Replies
shraddha_g
Partner - Master III
Partner - Master III

Try below expression,

if(dimensionality>1, sum(Sales),avg(Sales))

rubenmarin

Hi Fabio, if yer and month are dimensions you can check the level to set a different expression for the total:

Try set an expression with "=SecondaryDimensionality()" (without the double quotes)

It may show '0' in the total column and '1' in the months columns, in this case you can use this to set the different expressions, so the expression you need may be something like:

If(Secondarydimensionalty()>0,

YourCurrentExpression,

Avg(Aggr(YourCurrentExpression, YearFieldName, MonthfieldName)) // For Total column

)