Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

How to union all the last file by date and charge it in a table

Christopher_ZK
メテオロイド

Hello Everyone ,

I have a beginner level in alteryx designer .
I have many xlsx files in a repository :

South_01.01.2021.xlsx 

South_03.01.2021.xlsx 

South_04.01.2021.xlsx 

South_06.01.2021.xlsx 

South_02.02.2021.xlsx 

South_05.02.2021.xlsx 

South_06.02.2021.xlsx 

South_02.03.2021.xlsx 

South_05.03.2021.xlsx 

South_07.03.2021.xlsx 

I want to make a workflow that take the latest file of each month and union all, in this case :

South_06.01.2021.xlsx

South_06.02.2021.xlsx 

South_07.03.2021.xlsx 


The union result will be charge in a table 

Can you help me please 
Kind Regards

 

3件の返信3
Christina_H
マグネター

Use this formula to extract the date from the file names and convert it to the first of the month:

DateTimeTrim(DateTimeParse(Right([Filename],15),"%d.%m.%y"),"month")

 

Then use a sample tool to take the last row for each month.

 

Wrapped around this, you probably need a directory tool to get your list of filenames, and a dynamic input or macro to extract the data from them.

 

Christina_H_0-1677578293904.png

 

ShankerV
キャスター

Hi @Christopher_ZK 

 

Can explain you step by step to achieve the output.

 

Step 1: Use directory tool to read all the file names from the directory.

 

ShankerV_0-1677578333225.png

 

Step 2: Use Regex tool

 

(\d{2}.{8})

 

ShankerV_0-1677580205609.png

 

ShankerV_1-1677580217398.png

 

Step 3: Formula tool

 

DateTimeParse([RegExOut1],"%d.%m.%y")

 

DateTimeDay([RegExOut1])

 

DateTimeMonth([RegExOut1])

 

ShankerV_2-1677580901840.png

 

Step 4: Sort tool

 

ShankerV_3-1677580957427.png

 

 

Step 5: Sample tool

 

ShankerV_4-1677580986430.png

 

Post run: You will get the latest filenames for every month.

 

ShankerV_5-1677581029234.png

 

Many thanks

Shanker V

 

 

 

Christopher_ZK
メテオロイド

THANKS, IT WORKS

 

ラベル