Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Linear regression - datefield input

uhoelker
5 - Atom

Dear all,

 

I'm aiming to do a simple linear regression but I struggle to properly input my data. I have the following fields:

  • Year (Integer)
  • Month (Integer)
  • KPI (Double; will help to forecast the Target KPI)
  • Target KPI (Double)

See below a snippet of the input data:

 

input data.JPG

 

What I did so far is:

Lin Reg.JPG

 

As you can see the fields 'Year' and 'Month' are treated individually. Instead, I'd like to create a combined date field such as yyyy-mm-01 and use this as a predictor together with the field 'KPI'.

However, when I do this, the newly created date-field doesn't show up in the predictors menu.

 

In Tableau, where this work is done in the background, the result looks quite nice:

tableau.JPG

 

Can someone please point me in the right direction to create my regression based on the 2 predictors 'Date' and 'KPI'?

 

Many thanks in advance

5 REPLIES 5
alexnajm
17 - Castor
17 - Castor

If you are working with date data, you might want to instead use the Time Series tools!

 

This might be helpful to start: Performing Time Series Forecasting in Alteryx Designer - Alteryx Community

uhoelker
5 - Atom

Thanks for the quick response!

 

Yes, I also use ETS / ARIMA. But in addition, I want to do the linear regression.

OllieClarke
15 - Aurora
15 - Aurora

@uhoelker as @alexnajm says you'll want to use a time series tool (ARIMA or ETS) to do a time series prediction most likely. 

However, you can combine the Year and Month fields to create a new numeric field with a formula like:

[Year]+(([Month]-1)/12)


This will allow you to do your linear regression

Hope that helps,

 

Ollie

uhoelker
5 - Atom

Oh, that's smart and simple at the same time.

 

Thank you!

OllieClarke
15 - Aurora
15 - Aurora

@uhoelker 
I just did this approach with superstore and it does seem to marry
AlteryxAlteryxTableauTableau

Labels