Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
linoyel
Specialist
Specialist

Linest functions

Hi, does anybody know how to retrieve an "a" value in formula y=bx+a from LINEST functions?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can use the linest_b() function for that

LINEST_B - chart function ‒ QlikView

View solution in original post

13 Replies
swuehl
MVP
MVP

You can use the linest_b() function for that

LINEST_B - chart function ‒ QlikView

linoyel
Specialist
Specialist
Author

Linest_B doesn't give an "a" value from the formula y=bx+a

linoyel
Specialist
Specialist
Author

By the way, I'm talking about manual accumulative calculation. Maybe in accumulative it's different?
It seems that "a" = Linest_M+Linest_B. Am I right?

swuehl
MVP
MVP

Not sure why not. From the HELP:

LINEST_B() returns the aggregated b value (y-intercept) of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in the expressions given by the expressions x_value and y_value, iterated over the chart dimensions.

swuehl
MVP
MVP

Linoy, the linest functions consume a table with two related columns, one showing 'x' values, the other 'y' values (if you think of a cartesian x/y graph). These functions then calculate the 'slope' resp. the 'y-interception' of a linear regression.

Linear regression - Wikipedia

If the y-values in that source tables are cumulative numbers or not doesn't really matter for the linest function, that's part of your task as a developer to create / calculate the correct numbers to feed into the linest functions.

(There is no option or something like that you can enable with the linest functions to enable an automatic accumulation, if that's what you were thinking of, like in the line graph).

linoyel
Specialist
Specialist
Author

Yeah, i saw that but can you please look at the sample example attached? The manual calculated regression line matches the automatic one but b from y=mx+b seems to be equal to Linest_M+Linest_B:

3 + (- 0.67) = 2.3333

swuehl
MVP
MVP

Yeah, I believe the automatic linear regression equation shown in the chart is crap.

linoyel
Specialist
Specialist
Author

Ha ha ha

So, "b" value from the y=mx+b equation is b=Linest_M+Linest_B?


OR:


b = Linest_B and b value from automatic equation is wrong?

swuehl
MVP
MVP

The b value from the automatic equation is wrong, it's giving y-intersection value at x=1 (first x dimensional value), not at x=0. The equation clearly doesn't match the shown line.