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

Dynamic AVG (3 Rolling Months)

Hello,

I have the following table:

  • Period: Date Format: MM-YYY

PeriodTotalRentalExpensesKeyFPC
02-2016224117651725
03-2016243130661829
04-2016264148691829
05-2016259146711922
06-2016277159741924
07-2016295174772024
08-2016274154792022
09-2016262140802021
10-2016296169822124
11-2016295168842122
12-2016392249862235
01-2017287155872123
02-2017285152882223
03-2017301163902324
04-2017328187932325
05-2017350201952331
06-2017346194962431
07-2017368215992430
08-20173521991002429
09-20173361821012527
10-20173722131032631
11-20173001491042522
12-20172971471052420
01-20183201501102625

What I need is to create a Bar Chart with the AVG from Last 3 Months for each Period.

For example:

Average 3 Months.png

That means that for Period = 01-2018 with Value = 106,33, I get that result because if we look in the table, we have:

PeriodExpenses
11-2017104
12-2017105
01-2018110

(110 + 105 + 104) / 3 = 106,33

So I need to do this for each Period.

Do you know how could I do that?

Thank you!!!

PS: I attach a Sample File. The Sheet I need to complete is the 3rd one: Data By Average Months.

1 Solution

Accepted Solutions
sunny_talwar

May be use this

=RangeAvg(Above(Sum({<Period>}Expenses), 0, vI_QuantityAverages)) * Avg({<Period = {"$(='>=' & Num(MonthStart(Max(Period), -vI_QuantityMonths+1)) & '<=' & Max(Period))"}>}1)

View solution in original post

2 Replies
sunny_talwar

May be use this

=RangeAvg(Above(Sum({<Period>}Expenses), 0, vI_QuantityAverages)) * Avg({<Period = {"$(='>=' & Num(MonthStart(Max(Period), -vI_QuantityMonths+1)) & '<=' & Max(Period))"}>}1)

microwin88x
Creator III
Creator III
Author

Thank you!!!