Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
wttaryde
Contributor III
Contributor III

LinEst_R2

I have a calculation that works great to produce a bar chart.  I need to use the same calculation to calculate a KPI for the R2 value.  The attached App has the bar chart, a scatter chart and a KPI.  The bar chart has numerator/denominator.  Scatter has numerator = X and denominator = Y.  KPI is trying to replicate those and just give me the R2 value. 

Numerator =

Avg({1<Year = {$(=Max(num#(Year ,'####')))}>} Aggr(
Sum({1<QPermID={"TF0050_T_6*","TF0100_T_5*","TF0200_T_9*","TF0300_T_5*",
"DF0050_T_6*","DF0200_T_100*","DF0100_T_5*","DF0300_T_100*"}>}Response)
,YearID,Year))

Denominator =

Avg({1<Year = {$(=Max(num#(Year ,'####')))}>} Aggr(
$(vTDAssets)
,YearID,Year))

 

R2 calculation should be:

=LinEst_R2(
avg({1<Year = {$(=Max(num#(Year ,'####')))}>} total Aggr(
sum({1<QPermID={"TF0050_T_6*","TF0100_T_5*","TF0200_T_9*","TF0300_T_5*",
"DF0050_T_6*","DF0200_T_100*","DF0100_T_5*","DF0300_T_100*"}>}Response)
,YearID,Year))
,
avg({1<Year = {$(=Max(num#(Year ,'####')))}>} total Aggr(
$(vTDAssets)
,YearID,Year))
)

but it doesn't give a result. 

Thanks

Labels (1)
0 Replies