Skip to main content
Solved

MOVINGSUM with a variable/metrics as WINDOW SIZE

  • 19 August 2023
  • 5 replies
  • 247 views

Hi All, 

I am using MOVINGSUM which is very helpful but I stumbled on a challenge. 

I need to use a metrics as WINDOW SIZE rather than a fixed number. Basically the window size need to change dependently on month. I am getting the following error:

Error: Function MOVINGSUM requires second argument to be a scalar integer but is defined on Dimensions '00 Hub'::Month
Am I doing sth wrongly? Is there a workaround?

Regards,

Adam

Hi,
could you maybe share your formula? And the type and structure of your window size metric?

Thanks


Good morning,

This one was resolved yesterday during a session directly with Adam.
This is totally feasible by SELECTing the month in the driving metric of the window.


Yeap, all clear. Many thanks for your help!

Adam


Great to hear! :)


Hi all,

Just a small note on this topic.

The resolution that Fabien offered was about finding an alternative formula without using Movingsum() because the window size argument can’t be dynamic.

Example:

Movingsum(Metric,3)

would be the same as doing

Metric + Metriciselect:Month-1] + Metriciselect: Month-2]

 


Reply