Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mrainey18
Contributor

Linest_R2

LINEST_R2(

      aggr(avg(Hours),CalendarDate),CalendarDate

)

I am trying to calculate R but the number I am getting is really low.  Is there a way to increase the forgiveness of R.

I'm not talking about taking the square root of it.  Maybe rounding the average to the nearest integer?

7 Replies
MVP
MVP

Re: Linest_R2

For rounding you can do this....? But I am not sure if this is exactly what is needed here or not

LINEST_R2(

      aggr(Round(avg(Hours)),CalendarDate),CalendarDate

)

mrainey18
Contributor

Re: Linest_R2

I'm trying to measure the consistency of hours per day over a selected period using R.

Example: I have 7 days selected. 8.49, 8.39, 8.46, 8.24, 8.44, 8.13, 8.20, 8.15

R2 =  .62

I want that to read 1 or very close to 1 because they are all very close to each other.  I'm not sure why.

My next idea is to force a y intercept as the average Hours but I'm having trouble with the expression.

MVP
MVP

Re: Linest_R2

May be RoundUp or RoundDown using Ceil or Floor?

LINEST_R2(

      aggr(Ceil(avg(Hours)),CalendarDate),CalendarDate

)

or

LINEST_R2(

      aggr(Floor(avg(Hours)),CalendarDate),CalendarDate

)

mrainey18
Contributor

Re: Linest_R2

Update: Hours is a variable that is calculating the difference of a clock in to a clock out number.

LINEST_R2(

      aggr((avg($(vHours))),CalendarDate),CalendarDate

)

When I added Floor it did not return anything.

LINEST_R2(

      aggr(Floor(avg($(vHours))),CalendarDate),CalendarDate

)

MVP
MVP

Re: Linest_R2

What about when you used Round or Ceil? It works for these guys?

mrainey18
Contributor

Re: Linest_R2

No.  None of them work. 

I even tried adding Floor to my variable but I'm still getting a - in the table.

MVP
MVP

Re: Linest_R2

Not sure