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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Liner regression

Hello,

I found liner regression model y=a+bx. I separately found coefficients a and b by using this formulas:


b =  (sum(Sales*GP)-(1/Count(GP))*(sum(Sales)*sum(GP)))/(Sum(pow(Sales,2))-(1/Count(GP))*pow(sum(Sales),2))

a = avg(GP)-$(b)*avg(Sales)


b =  0.21566

a = - 0.99533

When expression is - 0.99533+0.21566*Sales everything OK.

When i trying visualize my liner regression using this expression $(a)+$(b)*Sales it shows me only one point not a line. Why?

1 Solution

Accepted Solutions
julian_rodriguez
Partner - Specialist
Partner - Specialist

Try adding the equal symbol "=" before the expression on the variable definition, like this:

b =  = (sum(Sales*GP)-(1/Count(GP))*(sum(Sales)*sum(GP)))/(Sum(pow(Sales,2))-(1/Count(GP))*pow(sum(Sales),2))

a = = avg(GP)-$(b)*avg(Sales)

View solution in original post

4 Replies
sunny_talwar

Have you tried the values in text box? If you did, did you try a or $(a)? May be you do not need to use dollar sign expansion here

a + (b*Sales)

Anil_Babu_Samineni

Try this

('$(a)')+('$(b)'*Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
julian_rodriguez
Partner - Specialist
Partner - Specialist

Try adding the equal symbol "=" before the expression on the variable definition, like this:

b =  = (sum(Sales*GP)-(1/Count(GP))*(sum(Sales)*sum(GP)))/(Sum(pow(Sales,2))-(1/Count(GP))*pow(sum(Sales),2))

a = = avg(GP)-$(b)*avg(Sales)

MarcoWedel

Hi,

maybe you could use predefined functions instead:

LINEST_M - chart function ‒ QlikView

LINEST_B - chart function ‒ QlikView

hope this helps

regards

Marco