Alteryx Designer Desktop Discussions

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

Returning employee ID as File name PDF

Dave
8 - Asteroid

Hi all, qq

 

Ive recently picked up a project from an ex colleague where we separate PDF files by employee ID. Its not something that Im overly familiar with having focused mainly on Excel based flows.

 

We have a PDF file with employee docs, where the employees ID is in a set position on every doc. We use alteryx to split the file into individual docs. 

 

The employee number appears as follows on the PDF

 

Dave_0-1652263104886.png

 

We use the following to convert the number into text for the purpose of file renaming - it creates a text called EE ID

 

Dave_1-1652263171583.png

 

At the moment its returning the first four digits and naming the new file accordingly - so the sample file would be "Doc_2132_Month" when the process closes

 

However I would like the name to be "Doc_144442_Month", basically ignoring the 2132 / 0 (returning the last 6 digits)

 

As a process it is running and closing out fine, its just I cant get the name to target the 144442 part

 

Can you advise on a solution?

 

Dave

10 REPLIES 10
DataNath
17 - Castor

If I'm understanding the question right then the following should work:

 

\/\s0(\d+)

 

DataNath_0-1652264083181.png

 

Alternatively, this is more dynamic and will just parse the last 6 digits:

 

.*(\d{6})

 

DataNath_1-1652264153031.png

 

Dave
8 - Asteroid

Thank you - is there a way to generalize it? The 2132 part can be a number of 4 digit combinations (the remainder is static)

IraWatt
17 - Castor
17 - Castor

Hey @Dave,

The solution I would use is to use a Regex expression like this in the parse tool:

Employee:.*\/\s*(\d+)

IraWatt_1-1652264216172.png

 

And output it as an integer to make sure there are no zeros at the beginning, then convert to a string with a select tool.

HTH,

Ira

 

messi007
15 - Aurora
15 - Aurora

@Dave,

 

Here you go : 

 

messi007_0-1652264237320.png

 

Attached the workflow,

Regards,

DataNath
17 - Castor

Sorry @Dave, made an edit as you were reading I believe! The second is more dynamic, it basically skips over everything until the last 6 digits in the field.

Dave
8 - Asteroid

This worked perfectly - thank you so much :)

Dave
8 - Asteroid

Slight update and question -

 

is there a way to stop the process running on pages where it doesnt find the "Employee:" qualifier. Right now its generating a file with no employee number for those pages. Id rather it produced nothing

 

Dave

IraWatt
17 - Castor
17 - Castor

@Dave could you add a filter like this and only continue the process for the true output :

IraWatt_0-1652272299977.png

Contains([Files Name],"Employee:")

 

DataNath
17 - Castor

@Dave before your output that produces the PDFs, could you not just chuck a filter in that checks !isnull([EE ID]) and then have the output coming from the 'True' anchor?

Labels