3 Replies Latest reply: Aug 17, 2017 11:30 AM by Sunny Talwar RSS

    Sum of Variable isn't returning a total sum

    Jennifer Doyle

      I have a measure, Amt, with 12 values (1 for each year).

      I created a variable for Amt, (because for some reason nothing would work with calling the measure directly)

      e_Amt = Above(sum([Amt],0,1))  // returns 12 values  << If there is a better way to get all values in a measure, I'd love to know. I tried just calling [Amt] for the variable and that didn't work.

       

      More variables:

      3yrMA                  = rangeavg(above(sum[Amt]),1,3)) // returns 11 values

      3yrMA_Resid       = $(e_Amt)-$(e_3yrMA) // returns 11 values

      3yrMA_ResidSqr = sqr($(3yrMA_Resid)) // returns 11 values

      3yrMA_RSS = sum($(3yrMA_ResidSqr)) // returns nothing

      3yrMA_RSS = sum("$(3yrMA_ResidSqr)") // returns zero

       

      I want the RSS to be the sum of all of the squared residuals, but as noted above, my attempts are unsuccessful. Any help would be appreciated.