ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
1 Day Left! - The Alteryx Community will be temporarily unavailable for a few hours due to implementation of the new SSO experience starting tomorrow at 5pm MDT. Please plan accordingly. For more information, read the blog.

Alteryx Designer Discussions

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

Enabling Disabling Containers based on a Condition

skotian1289
8 - Asteroid

Hello All,

 

I am not sure if it is a silly question but I need assistance to solve this issue. 

 

I have built a tool which has 3 different workflows for 3 different sales regions and all 3 workflows has a similar Input tool. The input file are named as "USA Sales.csv"  "Germany Sales.csv"  "France Sales.csv" and for all 3 regions I have created a seperate workflows because the file format and logics are diiferent, so we have Workflow 1 for USA, Workfow 2 for Germany, and Workflow 3 for France and every workflow has a email tool which sends out email to their respective sales team. I have setup a condition saying if the Filename has word "USA" then the file will be directed to Worklflow 1 or if it has "Germany" then it should be directed to workflow 2 and so on. 

 

My problem is everytime is run the tool all the 3 workflows runs and other 2 throws a error. I want to enable Diable my workflows based on same file name condition that if File name contains word "USA" then only workflow 1 should be enable and other 2 should be disabled and if File name contains word "Germany" then only workflow 2 should be enabled and other 2 should be disabled.

 

Is it possible to achieve this result in alteryx?

 

Sahil K

 

afv2688
16 - Nebula
16 - Nebula

Hello @skotian1289 ,

 

This is a quick demnostration in which by selecting on the dropdown what country you wanna process you can add the tools and the configuration you want as required:

 

Untitled.png

 

Within the macro, each process is saved inside it's corresponding macro. By selecting what country do you want to proceess, it enables or disables, depending on your selection.

 

Hope this helps.

 

If you have any further questions or doubts about it please let me know.

 

Regards

skotian1289
8 - Asteroid

@afv2688 - You are a genius, your technique works.

 

Just a small issue though with your technique the user will have to go open the workflow and select the specific option in Macro tab and then run the tool, what if is it is a scheduled workflow or the tool is automatically picking up the input file from a specific folder, do u think tool will be able to decide on its own based on File name which Macro option to select ?

 

Thanks a lot

afv2688
16 - Nebula
16 - Nebula

Hello @skotian1289 ,

 

thank you for your comments 🙂

 

I have switched the app to automatically select the country based on the data entry. The problem is that if you are inputting data from two different countries there would need to be some input to select the country.

 

Before using the app delete the filter on the app, I just had it there to switch and select the data for testing.

 

Regards

skotian1289
8 - Asteroid

@afv2688 - How about if I create multiple filter streams example: Field1=FRANCE and Field1=GERMANY and so on in the "Select Process" canvas and connect those individual filter tools with the macro logic you provided, this way everytime a different file is extracted by tool it will automatically run that specific stream and generate output and since rest of the stream will have all False data it will automatically not create any data ?

 

Do u think it is a good idea ?

 

Thanks

afv2688
16 - Nebula
16 - Nebula

Hello @skotian1289,

 

To avoid any problems, and to ease the proces, you just need to remove the filter tool on the app (do not touch the macros). Since the values are entering into a batch macro, the flow will process the information country by country:

 

- France data goes through france proces

- Usa data goes through Usa process

- etc

 

The results will be shown in the end toghether, like they were joined with an union tool.

 

If the amounts of columns don't match or you want them to be shown on different reports please let me know and I will do the adjustments.

 

Regards

Alexandra_Pops
6 - Meteoroid

Hello there @afv2688 

 

I think I could really use an idea from you : D 

 

I've been looking and trying to recreate as much as I could of your workflow hoping that I would be able to grasp the main idea, but unfortunately I can't seem to come any closer to what I have to do and that is: 

 

Enable / disable container based on date. I am working on a process with different phases.

                Process phase                                                Processing date

  1. Sending emails to employees.               1st of the month
  2. Payroll                                                    11th of the month
  3. Finance                                                  15th of the month
  4. Bank                                                       22nd of the month

Now, I could probably trigger them manually each on its corresponding date, but I, ideally, should upload it on the server and I was thinking that maybe with having each phase in a different container that would be enabled based on Today = Processing date (meaning workflow would run each day until condition is met) might save the trouble of triggering it manually. 

 

Worth mentioning that it is the first time trying to work with Interface tool so I'm having a hard time using them correctly.

 

Is this possible? 

 

I appreciate your time! 

 

Thanksies, 

Pops 

^__^ 

afv2688
16 - Nebula
16 - Nebula

Hello @Alexandra_Pops ,

 

Here you have an example how to do it in one workflow with containers.

 

My question is, why not doing 4 different workflows and schedule them each on it's corresponding day?

 

Regards

Alexandra_Pops
6 - Meteoroid

Hello @afv2688 

 

 

Thank you so so much!

 

Breaking it into 4 different workflows would have been my Go to solution had I not found help from you. 

 

To answer your question though.. I was hoping to be able to completely pass it under automated run (it's strongly recommended within the workplace :D) where possible.

 

My other approach was to use Filter tool within the workflow restricting the workflow to go any further if the Today Date was not equal to Process Date (that also allowed me to check if Process Date falls on weekend and replace it with previous working day) which i m not sure it can be included in the Formula within the Configuration panel of the Action tool. 

 

I had my 1st of month identified, I brought it to 11th for Payroll, checked if it fell on weekend and used IF to change it to previous Friday. therefore Process date was now 9th (April is a good example). 

 

I'll consider both ideas and discuss further. 

 

Once again, I appreciate it and I wish you le nicest week ^__^ 

Pops 

 

Labels