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: 
300sss300
Creator
Creator

How to use Average of 03 Months as Dimension ???

Dear All,

lets say I have 04 months Jan to Apr

I want to use average of First 03 months as Dimension in order to compare it with April in a chart.

Best Regards,

5 Replies
Kushal_Chawda

can you please post the sample data with expected output?

Not applicable

Will something like this help:

sum({<Mon={'Jan','Feb','Mar'}>}metric)/3

sum({<Mon={'Apr'}>}metric)

jonathandienst
Partner - Champion III
Partner - Champion III

There's a wealth of material covering this topic here. Did you try searching and researching for yourself?

You will need a calendar - search for master calendar

You will need to make sure you have proper date values

QlikView Date fields

And you can also look here

Calculating rolling n-period totals, averages or other aggregations

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable

Hi Khyam Aslam,

For use an expression as dimension, you have to use Aggr function:

Aggr(Avg({$<MonthYear = {'>=$(vPrev3Months)<=$(vActMonth)'}>} metric),dimension)

vPrev3Months  => MonthName(Addmonths(Max(Date)-3))

vActMonth      => MonthName(Addmonths(Max(Date)-1))

Kind regards.