Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
TinaH
Contributor III
Contributor III

Moving average for predicting future values

Hello together,

I am currently having a problem regarding the use of "moving averages" to forecast values.

Basically, I have the creation month "cr_month" of tickets and the amount of tickets created per month as a dimension (grey bars). Now, I want to forecast the number of tickets for the next 12 mnths using a linear model, which is working fine via linest_m and linest_b, and the moving average (cf. screenshot).

For the moving average, currently I am using the following logic:

 

if
(
   cr_month < 202201
   , count(distinct Ticket_ID)
   , RangeAvg(Above(count(distinct Ticket_ID),0,12))
)

 

So my question is: How do I estimate /forecast the number of tickets for the months 202202 - 202301?  Unfortunately, the moving average curve is currently decreasing.

Thank you very much!

Best regards
Tina

TinaH_1-1644853275919.png

 

2 Replies
chris_djih
Creator III
Creator III

1. moving average and forecasting are two fully seperate things!
as you already solved the linear variant. have a look at the other statistical forecast variants (exp, log).

Logarithmic ($1 iy your  measure (count) and $2 is your date-field):

linest_m(total aggr(If($2<=today(),$1),$2),(Aggr(Log(Rowno()) * $2, $2))) 
  * (Aggr(Log(Rowno()) * $2, $2))+ linest_b(total aggr(If($2<=today(),$1),$2),
    (Aggr(Log(Rowno()) * $2, $2)));

exponential ($1 iy your  measure (count) and $2 is your date-field):

exp(linest_b(total log(aggr(If($2<=today(),$1),$2)),$2)) 
   * POW( e(), linest_m(total log(aggr(If($2<=today(),$1),$2)),$2) * $2);


If you want a more detailied actual forecasting or as you mentioned  areal "estimating" you have to add advanced analytic connections to use machine learning models.

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.
TinaHensel
Contributor III
Contributor III

Thank you!