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

Alteryx designer Discussions

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

Gather all 9 clues to complete the final Weekly Challenge on Dec 16!

Learn More

Bringing in Historical Data

Asteroid

Hey yall,

I have built a workflow that grabs data from a clients excel file. Each month they send me a new one with the same dimensions. Is there a way to bring in each new months data and compile it with the last without having to copy and paste the workflow below each other? I want to be able to somehow just add the new month file while keeping all the previous months without having to switch each month in the input data tool because I will than export it into tableau to show past performance. Thanks!

Magnetar
Magnetar

Hi @chughes49 

 

If the new month has the same schema, you can always use a wildcard input.

Connect to a file as you would normally, and then go to the configuration window, remove what doesn't match month to month and replace with an *

For example, if I have DataJan.xlsx, DataFeb.xlsx, DataMar.xlsx, I would set the file name to Data*.xlsx.

 

That will pull in all files that are Excel in that folder, and whose names begin with Data.

 

Let me know if that works!

 

Cheers,

Esther

Asteroid

@EstherB47 ,

 

 

Would that still work if in my workflow? I am using the select records tool to gather specific rows in that file so I cant have them become unionized because it wouldn't pull the selected rows correct?

 

Magnetar
Magnetar

Hi @chughes49 

 

It could work. Are the same number of records selected each month? Then I'd use a Sample tool instead of Select records, with a Grouping field on whichever field indicates the month (or the different file). An easy way to include a field like this is in the Input tool, set the Output File Name as Field to File Name Only, and use that in the Sample tool.

 

Otherwise, I'm thinking that you could use a Directory tool (read all files)+ Sort (most recent on top)+ Sample (first record only)+ Dynamic Input tool to select just the most recent file, go through the workflow, and in the Output File stage, choose to append onto an existing file.

 

Cheers!

Esther

Labels