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: 
maxsheva
Creator II
Creator II

Regression line issue

Hi,

Please help to find correct solution for regression line.

I have data where dimension is not numerical.

I decided to use Dual for that. But as result after script works it has not all numbers one by one.

Regression line shows incorrect results in this case.

Assume please 'Name' field as result of Dual function.

LOAD * INLINE [

Name, ValueID

1, 2

2, 6

4, 8

];

Thx.

6 Replies
sunny_talwar

What is the output you are looking for?

maxsheva
Creator II
Creator II
Author

I need the same regression line as QV auto creates it.

The issue I can't reach correct numbers (one by one) in dimension 'Name'

It depends on data model which has specific requirements.

I'd like to find correct Linest_M and Linest_B when dimension numbers are 1,2,4 instead 1,2,3

sunny_talwar

And are you saying that the correct values are 3 for Linest_M and 2.3333 for Linest_B? (Instead of 1.86 and 1)?

maxsheva
Creator II
Creator II
Author

Sunny pls look at this qvw file.

When I include option 'Continuous' on the Axis tab it shows the same as table.

But in this case dimension shows only numeric values instead text from Dual.

So I can say formula probably correct but visualization is not as expected if use only text dimension in chart.

sunny_talwar

I guess what you are saying makes complete sense.... but is there something you would want to change? I am trying to figure out what you are expecting to see and where?

maxsheva
Creator II
Creator II
Author

I'd like to get visualization with only text(Names) as dimension and true(straight) regression line.

As far as I see I need fill Linest_M and Linest_B with numeric 'Name' field where count should be (1,2,3) instead (1,2,4)

Probably I don't need use 'Name' field in Linest_M and Linest_B. But RowNo() function doesn't give correct result.