community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Linear regression

Atom

Hello All,

 

I am new to the Alteryx Community and hope to get some useful tips from you ;)

 

What I am trying to do is analyse consumption data of different articles accros time

I would like to calculate in alteryx y = ax + b for each article and use it as data for further analysis

 

Input:

 

WeekArticleQuantity
1Article 15
2Article 18
3Article 111
4Article 114
5Article 117
6Article 120
7Article 123
8Article 126
9Article 129
10Article 132
11Article 135
12Article 138
13Article 141
14Article 144
15Article 147
16Article 150
17Article 153
18Article 156
19Article 159
20Article 162
21Article 165
22Article 168
23Article 171
24Article 174
25Article 177
26Article 180
27Article 183
28Article 186
29Article 189
30Article 192
31Article 195
32Article 198
33Article 1101
34Article 1104
35Article 1107
36Article 1110
37Article 1113
38Article 1116
39Article 1119
40Article 1122
41Article 1125
42Article 1128
43Article 1131
44Article 1134
45Article 1137
46Article 1140
47Article 1143
48Article 1146
49Article 1149
50Article 1152
51Article 1155
52Article 1158
1Article 2158
2Article 2155
3Article 2152
4Article 2149
5Article 2146
6Article 2143
7Article 2140
8Article 2137
9Article 2134
10Article 2131
11Article 2128
12Article 2125
13Article 2122
14Article 2119
15Article 2116
16Article 2113
17Article 2110
18Article 2107
19Article 2104
20Article 2101
21Article 298
22Article 295
23Article 292
24Article 289
25Article 286
26Article 283
27Article 280
28Article 277
29Article 274
30Article 271
31Article 268
32Article 265
33Article 262
34Article 259
35Article 256
36Article 253
37Article 250
38Article 247
39Article 244
40Article 241
41Article 238
42Article 235
43Article 232
44Article 229
45Article 226
46Article 223
47Article 220
48Article 217
49Article 214
50Article 211
51Article 28
52Article 25

 

Target Output:

 

Articleab
Article 1321
Article 231611

 

Do you know if there is a quick way to do this without having to go through lengthy calculations?

 

Thanks!

You could use the predictive tools but think you would need to batch macro it to make it run group by group.

 

I attach a macro implementing Linear Regression using Summarize Tool and Formula Tool (Slope and Intercept are easy enough, RSq is a bit horrific)

 

Nice thing is it is blisteringly fast as all native core Alteryx tools

 

 

Bolide

Hey @rcauquil, I see that @jdunkerley79 already provided something similar, but here is a macro with some R script that does these computations. Hope this helps :). 

Atom

Thank you so much @jdunkerley79 

You just saved me a lot of hours! works perfectly

Atom

Hey @JoBen - works great!

Labels