Alteryx Designer Desktop Discussions

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

Read the most recent excel file with the file name in a column

danmendo
Meteoroid

Hi,

 

I am trying to read the most recent file from a specific folder, but i need also the file name in the input data.

 

When i read a excel file i can select the option who take the file name into a column:

 

danmendo_0-1679668019692.png

 

So i am using the follow workflow to read the most recent file, but i dont know how to take the file name in a column:

 

danmendo_1-1679668224876.png

ignoring the warning, the goal of this workflow is sort files in the folder and take the most recent file, and the dynamic input read the respective file, but in this tool in dont have the possibility of take the file name like a column.

 

I hope you understand my situation and help me.

 

Thanks so much!!

 

8 ANTWORTEN 8
FinnCharlton
Pulsar

Hi @danmendo , there is an option for this in the Dynamic Input tool, just in the "Input Data Source Template" menu. Hope this helps!

FinnCharlton_0-1679668872107.png

 

BS_THE_ANALYST
Magnetar

@danmendo I can see this issue. I'd use a macro for this. Try the attached worklow:

BS_THE_ANALYST_0-1679669696398.png

 

 

danmendo
Meteoroid

Thanks!

BS_THE_ANALYST
Magnetar

@FinnCharlton if you're going to have to select the file using the file template, they may aswell just use a File input to begin with. 

I think the idea is, they bring the most recent file onto the workflow (in a certain location), and then they feed this into a tool that automically brings this onto the canvas without them having to point the tool anywhere. 

Can't think of anyway to achieve this besides using a macro. 

 

BS_THE_ANALYST
Magnetar

If you want this to also output the file name:

BS_THE_ANALYST_1-1679670317442.png

 

 

FinnCharlton
Pulsar

@BS_THE_ANALYST You always have to specify a template file while using the Dynamic Input tool. Changing this setting for the template file will output the File Name for all dynamically inputted files, without needing a macro.

BS_THE_ANALYST
Magnetar

@FinnCharlton 
"So i am using the follow workflow to read the most recent file, but i dont know how to take the file name in a column:"

 

Firstly, why would you use the dynamic input tool to read in one file? 

I'm seeing it that they use a directory tool, then "sort by" to get the most recent file, use the sample tool to take 1 recent file. They then need to feed this file path into a tool that will take that file path, read it, and read the file into the workflow, and also output the file path itself.

If you're going to the extent to select the template file in the Dynamic Input tool, you can achieve the same result just using a File Input tool to start with. It just seems redundant. 

Am I missing something? 😂. Seems like a macro is actually what's needed:

BS_THE_ANALYST_2-1679671297005.png

 



 

FinnCharlton
Pulsar

@BS_THE_ANALYST , The template file only needs to be chosen once when the workflow is built. The dynamic input tool can then dynamically change which file it is inputting, based on the data it receives from the rest of the workflow.

 

If you used a normal input tool, you would need to change this tool every time there was a new most recent file. So dynamic input seems like the best choice to me, accomplishes the same as a macro but quicker to set up.

Umfrage
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Beschriftungen