Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Is there an easier way to treat my case? (input case repeat)






I have created a app aiming at treating a test each 6 months: each year, one test for January - June, another test for July - December.


So i'd like to have a "drop down" tool to select the test:


For example, if we choose "1er semestre", then we will import all files named JAN, FEB, MAR, APR, MAY, JUN

And if we choose "2eme semestre", we will import all files named by other 6 months.


I'm curious if anyone has a easier way to not to repeat the same action 6 times? Because now my flow seems like really ugly...............


Thanks a lot.

ACE Emeritus
ACE Emeritus

Is it possible to rename your files? e.g. 1_Jan, 1_Feb, etc... 2_July, 2_Aug, etc...?  If so then you could gather them using a wildcard, and use dynamic input to do one read... here's a mock up (where I had files named accordingly in the test path shown).



Sometimes I make my workflows "dumber" in order to accomplish things like this. First I would create a new field that numbers the months so they're in order. 01-Jan, etc (could use a lookup table for this). Then, using either a lookup table or a formulaic filter, I would just tell Alteryx if 1-6 then semester 1 else semester 2. If you need portions of those semesters it's not too hard to make a lookup table that has fields for 12 mo, 9 mo, 6 mo, etc.


I actually was just struggling with this using Tableau and finally decided it's faster to just do it the old fashioned way... make a date table and then make fields like Last 12 wks (Y/N), Last 4 weeks (Y/N).


While it builds my skills better to try to figure out a way to do this stuff programmatically, as @JohnJPS has done, if you're in a time crunch, I find it sometimes helps to make things less automated.


@JohnJPS and @cbridges beat me to it, but I just added a text input tool to handle the translation and used a dynamic input to read all the files. I passed the output filename as a variable.


This is assuming that all your input files have the same column names, otherwise you will get all the columns in all your outputs (which would have nulls). If you have different column names, a batch macro which housed the input and output would work. Hope it helps!

ACE Emeritus
ACE Emeritus

I think @patrick_digan takes the best elements of both my and @cbridges comments, and builds them into the final answer. Nicely done!



Excellent answer help a lot, thank you very much!


It makes sense to keep things stupid instead of making everything automated. In fact, finally i kept my same workflow repeated to my test, even it is a little bit ugly.


You know what, as a chinese i find sometimes automation will reduce the employment rate and that's why china have powerful technique but we try keep things in manual, such as the gas station, supermarkets


Thanks for your best idea to sepreate my flow from 2 parts!