Alteryx Designer Desktop Discussions

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

Automated Forecasting Help?

Kyra88
6 - Meteoroid

Hi All !

 

I was wondering if anyone can help me reach a solution.

I would like to know if it is possible to automate forecasting data on Alteryx?

 

I have attached a sample excel file where I manually input a forecast growth % value for the market and company to determine the companies forecasted sales value and market share.

(The forecast values are based on a % increase from the same month in the previous year - Year on year)

 

Are there any tools in Alteryx where I could replicate this? As well as any tools in alteryx that are similar to Excel's 'Scenario Manager' and 'Goal Seek'? The main aim is for the model to be automated.

 

I have also attached my workflow so far.

 

All suggestions are welcome! Thank you in advance!

10 REPLIES 10
AngelosPachis
16 - Nebula

Hi @Kyra88 ,

 

If you want to enable your user to manually input the market and company growth rates in a more user friendly environment than an Alteryx workflow, then an Analytic App is what you are looking for.

 

If you want to get the different outputs for different market/company growth rate combinations, then I believe your answer would be a batch macro.

 

Which path would you rather work towards? I'm not familiar with the Scenario Manager and Goal seek functionalities in Excel, but I'm pretty confident that this can be recreated in Alteryx.

 

Regards,

 

Angelos

Kyra88
6 - Meteoroid

Hi @angelospachis

 

Thank you for your reply.

 

I was looking to get different outputs for different market/company growth rate combinations.

 

Scenario manager is a tool that automatically changes the input value to determine the output of different scenario's. Goal seek is a tool which lets the user choose a desired output and the tool will determine the optimum input values to reach the output goal.

 

I'm a fairly new Alteryx user so I'm not to familiar with batch macros.

 

I look forward to your reply.

 

Many Thanks,

Kyra

AngelosPachis
16 - Nebula

Hi @Kyra88 ,

 

For the scenario manager instance, I think the answer is a batch macro. For goal seek I think the answer may be a batch macro on an iterative macro.

 

The difference between a batch macro and an iterative macro, is that the former runs for every value/set of values within a list that are fed to the macro, whilst the latter runs until a condition defined by the user is met.

 

For you requirement, I have created a batch macro that I will try to explain in as few words as possible how it works. It's not a finalised perfect product, but it can serve as a proof of concept of what Alteryx can achieve and may be tweaked to meet all requirements.

 

Step 1 : Generate a list of all the different combinations of company/market forecast rates. 

 

To do that, I've used two "Generate Rows" tools, both generating rows from 1-10% (10 rows each, making 100 different combinations)

 

AngelosPachis_0-1607290912624.png

 

Step 2 : Create the process that wants to occur in each run in your batch macro.

 

Well generally the process I would want to happen in each run is described below:

 

AngelosPachis_1-1607291514359.png

My macro in each run will load the market/company sales tables, bring them in a format to forecast the values and then use a forecast ratio defined by the user, join them to get the total market share and restructure them in the old format for output.

 

Step 3 : Change the forecast ratio for company/market.

 

That happens via the tools with a black and white colour shown below, which in each run update the originally used forecast value.

 

AngelosPachis_2-1607291710578.png

 

What these tools do (and there are two of them in the workflow) is to update the ratio used in each run. The first will read from the Market forecast column (as that was shown in the first image attached to this post)  and the second from the Company Forecast column. In the first run, both will feed in 0.01 (or 1%) because these are the values in the first record. The macro will run and will output Company/Market/Total Marketshare data out of the three outputs.

 

When that is done, the macro will run again for Market Forecast of 0.01 but a Company forecast of 0.02 and will create 3 new tables for Company/Market/Total Marketshare, which will be appended to the old ones. The process will go on until there are no more combinations left to be fed to the batch macro. In our instance, since there were 100 unique combinations, the macro will run 100 times.

 

Feel free to have a look at the workflow to better understand what's happening in each tool and please reach out if you have any further questions. The concept of a batch macro is a bit tricky to grasp, especially if you are fairly new Alteryx user.

 

To open a batch macro and explore it, just right-click on it and select open from the drop down

 

Screenshot 2020-12-06 220134.jpg

 

Regards,

 

Angelos

 

Kyra88
6 - Meteoroid

Hi @angelospachis

 

Thank you so much! I really appreciate the time and effort you've put into helping me.

 

Just one issue, I'm unable to open the workflow. I keep getting an error message saying unable to open workflow due to it being created in a more recent version of Alteryx. I've also tried to open the workflow via the zip file downloaded and open the .yxmd file, but that still doesn't work.

 

Is there any way to around this? And also, do I need to save the batch macro ?

 

Sorry for the inconvenience.

Thank you in advance

 

Kyra

AngelosPachis
16 - Nebula

Hi @Kyra88 ,

 

Just saw this, on which version of Alteryx are you on? I can try and send over the correct version for you or you can try fixing it yourself. 

 

All you have to do is open that zip file, and there you should have the batch macro and the workflow.

 

Then open a text editor (notepad) and drag your workflow in the notepad as shown below:

 

Macro Example.gif

 

Change the version from 2020.3 to your version ("2019.2" for example) and then from " the top left of the notepad click on "File" > "Save".

 

Do the same for the batch macro. Now you should be able to open them in Alteryx and not receive that error message.

 

Let me know if that worked for you.

 

Cheers,

 

Angelos

Kyra88
6 - Meteoroid

Hi @angelosPachis

 

Thank you so much! The macro is EXACTLY what I needed!

I truly appreciate your time and efforts!

 

Sorry to be a pain but I have one more query. I now have to include a subsidiary company in the forecast to find the total company market share. The subsidiary has a greater forecast % so the forecast can even be up to 100%.

 

I've tried to add a new column to generate rows for the forecast values in the Workflow but I'm struggling to replicate what you created in the batch macro. I assumed that I could copy the workflow but I can't get past the multi row formula tool.

 

How can I over come this?

 

Thank you again!

 

Kyra

AngelosPachis
16 - Nebula

Hi @Kyra88 ,

 

The issue for me was that when I was reading that excel table for Company A2, then for some reason Alteryx was picking up the last field called F15 and that was messing up the data structure after pivoting the data.

 

To face that, I configured the transpose tool so it only pivots fields that have Month as a name, so :

 

AngelosPachis_0-1607693267575.png

 In the data column, I have unselected F15 and the last option. Now every new fields won't be pivoted and will be dropped, which can be a good thing because it gives you consistency, but also a potential source of error if your months change from Oct > Octob or October; Alteryx won't understand the difference and you will lose that column.

 

I went on and added some interface tools that allow you to select which file you want to connect to for each Company/Market, so you won't have to replace the files in the macro in the future. From the macro interface, you are prompted to connect to a file.

 

AngelosPachis_1-1607695362176.png

 

You can remove them if you don't find them useful.

 

Finally, if you want Company A2 to use all possible forecast (1-100%) that means that you will then create 10000 different combinations which should then be fed into the batch macro. That means that performance will be compromised to get all possible forecasts (it took 7 mins to run for my laptop)

 

Let me know if it worked for you. If you add many more companies then probably we should come up with an alternative plan, but for those 3 that should do the trick.

 

(PS you might have to change the version again for the attached items)

 

Regards,

 

Angelos

Kyra88
6 - Meteoroid

Hi @AngelosPachis 

 

Thank you for the quick turnaround!

 

I just have a little issue. The Batch macro runs fine but when I run the workflow I getting the below error message.

Kyra88_0-1607697865733.png

Also quick question! Should there be a connection for the 3rd summary tool for the A2 output?

Kyra88_1-1607697961471.png

Thank you again for your time!

 

Kyra

AngelosPachis
16 - Nebula

Hi @Kyra88 ,

 

Don't know why this might be. There is this bottom part that is meant for company A2 and that has an output at the end of it so your macro should have 4 outputs instead of 3.

 

Screenshot 2020-12-11 152011.jpg

 

That error means something is wrong in the multi-row formula tool in that company A2 stream (the one after the Formula tool where we create the forecast for each run).

 

The error means that one of the fields used in that expression (Value or A2 forecast) is read as a string. Can you check if that is the case?

 

If you can't figure it out, you can add a select tool in between the formula tool and the multi-row formula tool and force the value and A2 forecast fields to take numeric values (set them to double)

 

AngelosPachis_1-1607700358891.png

 

Let me know if that worked for you.

 

Labels