Free Trial

Alteryx Designer Desktop Discussions

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

Extract Date found at the End of the File

KamenRider
11 - Bolide

Hi,

 

Can please help me scenarios on how to get the date at the end of the filename?

 

WWW Weekend Holiday Tune Expiration Report 06.03.24

 

Thanks,

 

Kamen

 

8 REPLIES 8
cpet13
11 - Bolide

@KamenRider if you have the file name coming into the workflow as a field, which you can setup by using the configuration window for the input tool, and if the date is always going to be in that same format (xx.xx.xx), then you can use a the function RIGHT(FileName, 8) to get the date. Note, however, that the field will not appear as a date to Alteryx - Alteryx workflows use the format similar to xx-xx-xxxx. If you needed to, you could easily replace the . with - in the formula tool. Here is a simple example of how to parse the filename.

cpet13
11 - Bolide

Here is the option to output a file name as a field -

Screenshot 2024-06-14 093907.png

KamenRider
11 - Bolide

Hi @cpet13 

 

How to I remove if the extension xlsx?

 

Kamen

KamenRider
11 - Bolide

Sorry, this should be the correct filename

 

WWW Weekend Holiday Tune Expiration Report 06.03.24.xlsx

 

need to extract the date...

 

Please help

 

Thanks,

Kamen

cpet13
11 - Bolide

@KamenRider in the field to output the file name you can choose the option, "File Name Only." Doing that, it will not bring in the extension to the field.

KamenRider
11 - Bolide

HI @cpet13 

 

Thanks but is there a way we include to remove the xlsx in the formula?

 

Kamen

cpet13
11 - Bolide

Yes, there is a Replace function you can use. This would be how the formula would look with the Replace function removing the .xlsx - Replace(Right([FileName], 8), ".xlsx", "")

KamenRider
11 - Bolide

Thanks @cpet13 . I change the value 8 to 13 >>>  Replace(Right([FileName], 13), ".xlsx", "")

 

Kamen

 

Labels
Top Solution Authors