Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

doyleax123
New Contributor

Sum of Variable isn't returning a total sum

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.

Tags (1)
3 Replies

Re: Sum of Variable isn't returning a total sum

How about this

3yrMA_RSS = Sum(3yrMA_ResidSqr)

doyleax123
New Contributor

Re: Sum of Variable isn't returning a total sum

Since 3yrMA_ResidSqr is a variable, doesn't it need to be referenced like $(3yrMA_ResidSqr) ?

Re: Sum of Variable isn't returning a total sum

That is not necessary.... have you given it a try?

Community Browser