0

I know that we can use inbuild function “Moving Average” to calculate rolling average with specific intervals like 3 months, 12 months, etc.. Is it possible to divide two moving average values to get the “Per system value”.

For example:

Moving average 1: Total number of Hrs Moving average 2: Total number of systems

Per System = Total number of Hrs/ Total number of systems

Appreciate your help and suggestions.

sasecse
  • 69
  • 4
  • 16
  • What have you tried so far? Please use `dput()` to present your data. – jogo Apr 06 '17 at 11:34
  • @jogo Thanks. I tried creating a calculated column to calculate the moving average by using a case statement to limit the period but it didn’t turn up well. – sasecse Apr 06 '17 at 11:39
  • 1
    Please show your code and your data, i.e. edit your question: http://stackoverflow.com/posts/43253870/edit . Please read [ask] and [mcve] and http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example In the current form your question is off-topic on SO. – jogo Apr 06 '17 at 11:46
  • Are you trying to use TERR for this or Spotfire built in functions? – S3S Apr 06 '17 at 11:49
  • @scsimon Thanks. I was trying in both ways. I found a simple solution. – sasecse Apr 10 '17 at 11:51

1 Answers1

0

Found a solution.

  1. Create a simple calculated column using "OVER" & "Intersect" function to calculate the Moving Average . For example: SUM([Total number of Hrs) OVER (Intersect(LastPeriods(12,[Yr_Mn]),[XXX])) / 12"

Also use the same logic to calculate moving average for Total number of systems.

  1. In the visualization, using "First" function, exclude the duplicates. For example:
    First([Total number of Hrs]) / First([Total number of systems] as [Per System Value]
sasecse
  • 69
  • 4
  • 16