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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Artik
Partner - Contributor III
Partner - Contributor III

polynomial regression model in qlik sense

Hi Team,

Anyone created "Polynomial Regression Trend" in Qlik sense.

Please share the knowledge/set expression anything on same.

Thanks,

Aarti

Labels (1)
2 Solutions

Accepted Solutions
igoralcantara
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Aarti,

Yes, you can create a Polynomial Regression Trend in Qlik Sense. Here’s a basic outline of how to do it:

1. Prepare Your Data: Ensure your dataset includes the variables for which you want to establish the polynomial regression.
2. Load the Data: Load your data into Qlik Sense.
3. Create a Scatter Plot: Create a scatter plot to visualize the relationship between your variables.
4. Add Polynomial Trend Line:
• Go to the scatter plot properties.
• Navigate to Data, to your measure properties and select “Trend Lines.” 
• Choose “Polynomial” and set the degree of the polynomial (e.g., 2 for quadratic, 3 for cubic).
5. Set Expression for Polynomial Regression: If you need more control, you might want to set your own expressions. Here’s an example for a quadratic polynomial regression (second-degree polynomial):

y = a + bx + cx^2

5. You can use the LINEST_M and LINEST_B functions in Qlik to calculate the coefficients a, b, and c.

Here’s a simple script to calculate these coefficients:

// Example of data load script
LOAD
YourXField,
YourYField
FROM [YourDataSource];

// Calculation of coefficients
LET vA = LINEST_B(YourYField, YourXField, 2);
LET vB = LINEST_M(YourYField, YourXField, 1);
LET vC = LINEST_M(YourYField, YourXField, 2);

// Create polynomial expression
SET vPolyExpression = $(vA) + $(vB) * YourXField + $(vC) * YourXField^2;

 

 

Check out my latest posts at datavoyagers.net

View solution in original post

Artik
Partner - Contributor III
Partner - Contributor III
Author

Thank you so much for the detailed answer @igoralcantara Yes this works 👍

View solution in original post

3 Replies
marksouzacosta

Hi @igoralcantara, I think you can help on this.

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

igoralcantara
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Aarti,

Yes, you can create a Polynomial Regression Trend in Qlik Sense. Here’s a basic outline of how to do it:

1. Prepare Your Data: Ensure your dataset includes the variables for which you want to establish the polynomial regression.
2. Load the Data: Load your data into Qlik Sense.
3. Create a Scatter Plot: Create a scatter plot to visualize the relationship between your variables.
4. Add Polynomial Trend Line:
• Go to the scatter plot properties.
• Navigate to Data, to your measure properties and select “Trend Lines.” 
• Choose “Polynomial” and set the degree of the polynomial (e.g., 2 for quadratic, 3 for cubic).
5. Set Expression for Polynomial Regression: If you need more control, you might want to set your own expressions. Here’s an example for a quadratic polynomial regression (second-degree polynomial):

y = a + bx + cx^2

5. You can use the LINEST_M and LINEST_B functions in Qlik to calculate the coefficients a, b, and c.

Here’s a simple script to calculate these coefficients:

// Example of data load script
LOAD
YourXField,
YourYField
FROM [YourDataSource];

// Calculation of coefficients
LET vA = LINEST_B(YourYField, YourXField, 2);
LET vB = LINEST_M(YourYField, YourXField, 1);
LET vC = LINEST_M(YourYField, YourXField, 2);

// Create polynomial expression
SET vPolyExpression = $(vA) + $(vB) * YourXField + $(vC) * YourXField^2;

 

 

Check out my latest posts at datavoyagers.net
Artik
Partner - Contributor III
Partner - Contributor III
Author

Thank you so much for the detailed answer @igoralcantara Yes this works 👍