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

Alteryx designer Discussions

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

Dynamic upload of input file

Asteroid

Hello community,

 

I need to generate recurring reports every month using 3 different streams of data

 

For example, for the month of May 2019 I need to generate

1. Hires for May 2019

2. Departures for May 2019

 

Similarly, next month I need to generate same reports for June 2019.

 

I was wondering if there is a way to just change a single particular field from May to June and accordingly the input changes from the May files to June files and similarly the naming convention of the output files changes from May to June?

 

 

Alteryx Partner

@ankitsingh2063 

 

I would use the formula below, updating 'DateTimeNow()' with the date in your report that represents the month you're reporting on. If you have no such field, you could subtract one month from DateTimeNow() and parse out the month name like I've done below.

 

DateTimeFormat(DateTimeNow(),'%B')

Asteroid

Thank you for a quick response @john_miller9 

 

While this is a good idea but I don't think it will replace my input of May files by June files. I want to get rid of the possibility of errors that I might make while changing the input files every month - I would rather just change a particular parameter from May to June and rest Alteryx does it for me.

Alteryx Partner

For dynamically selecting the appropriate input files, you can use the directory tool to grab the list of files in the folder(s) along with filter(s) to grab the files you're looking for.  Then use the method I described earlier to dynamically name the report output.


Do your input files have a date appended to them, or month name, or some other structure?

 

This post here goes into a lot of detail around different methods to choose depending on the scenario:

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/The-Ultimate-Input-Data-Flowchart/t...

 

Alteryx Partner

See the example attached which should show the steps to accomplish this

 

Dynamic Input Output.png

Asteroid

Thanks again @john_miller9 .

 

I am not sure if I am using the latest version of Alteryx (I am using v 2019.1.6.58192). Somehow, my Formula tool doesn't recognize the function 'Split'.

Alteryx
Alteryx

I think Split may be a custom functions that @john_miller9 has built/added in.

 

One other thing to consider would be the use of a workflow constant.

 

You could set up the workflow to use the constant in your input and output tools and then just update that.

 

I have attached an example that uses two constants for an input tool, the month and year.

 

Workflow.jpg

Alteryx Partner

@ankitsingh2063 

 

The split function comes from @jdunkerley's Abacus add-in.  You should install it as it has a whole host of useful ways to extend Alteryx's out of the box functionality.

 

https://community.alteryx.com/t5/Engine-Works-Blog/An-Overview-of-the-Alteryx-Abacus-Add-In/ba-p/398...

 

Alternatively you could use other functions that are native to the Formula tool or RegEx tool

 

See updated workflow attached.

Labels