Alteryx Designer Desktop Discussions

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

Move jpeg files to different folder depending on file names

filipaf4
5 - Atom

Dear all, I need to move certain images from a folder (depending on if the image name have certain characters such as '( )' ), to a different folder.

Tried to use the Run Command macro but it only allows for outputs in plain text or csv... Any ideas?

 

Many thanks in advance!

 

11 REPLIES 11
JimBow
6 - Meteoroid

Hi David,

 

Still new to this myself but spent the last 3 days working on the best fit for me. Been programming vba for about 6 years now, so a it more experience there.

 

I tried the approach you're suggesting but I ran into a few issues. Mainly, the only way to get data into the workbook is using the Legacy .xlsx output, delete & append data function. The downside to this is it creates a table in which to link. Everything works fine as long as your column headers stay 100% consistent, which is ok on face value. But as soon as they are not aligned, the excel workbook will become unusable until you remove and replace the table... and re-do all your formatting. Usually throws a endless repair loop which Microsoft have no fix for.

 

The much more efficient way seems to be the following.

 

1. Use Alteryx to blend the tables and data you wish to be in the workbook and save this as a data file with zero formatting to disk. Mines in a standard .xlsx, but you could use .csv (in fact, if your data has dates, 100% .csv as the import wizard in Excel works a treat for that).

 

2. Then build a formatting workbook in excel, using VBA code to open and apply the changes to the data file, and saves to another folder with the naming convention you want.

 

3. Then use the Events tab in Alteryx to run a .vbs script using wscript, which opens your formatting workbook and runs the macro processing the data file. This leaves the data file intact and ready to be overwritten on the next run.

 

Hope the above makes sense? I find this a lot easier as I can dynamically reference ranges in Excel, so if I want to change a column header or add another column to the table in future, I can do so knowing I wont kill all my formatting. I am very happy with the result, even though it was my last resort in terms of ideal. I didn't really want to get into any VBA coding as it scares the hell out of people, but used in this way, it becomes almost a code extension of Alteryx and no-one sees it. Excel appears for about a second and I don't even see the interface.

 

Plus it makes me look like a god in the office! :)

 

Something similar here, but if you're struggling let me know and I'll try to document what I have done in a better way.

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Call-VBA-macro-from-Alteryx/td-p/46062...

 

ignas
8 - Asteroid

Hey @jdunkerley79 

 

I have the same need but I cannot fully understand where you get the .bat file from in the filter icon?

As I understand the directory is the input files that need to be copied.

 

Regards,

 

Ignas

 

 

Labels