Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Regression line for scatterplot

Hi!

I know this has been discussed multiple times but the proposed solutions aren't working and I was hoping someone could help out. I am trying to add a regression line to my scatterplot.

I used both of the formulas below in the "reference line expression" field but in both instances nothing happens. Could someone please correct my code or let me know if there's another way to add such a line?

=linest_m(total aggr(if(sum(Percent_GNI),sum(Percent_GNI)),Index1),Index1) *
only({1}Index1) +
linest_b(total aggr(if(sum(Percent_GNI),sum(Percent_GNI)),Index1),Index1)

=LINEST_M(Percent_GNI,Index1)*ONLY(Index1)+ LINEST_B(Percent_GNI,Index1)