Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Output to existing Excel file as a new sheet after each run (dynamically named)

Highlighted
5 - Atom

Hello

 

My company has a system from which I can run reports at any given time.  The data is raw and not easy to visualize so I am using Alteryx to automate the formatting.  It's a report I may run several times a day and I want to keep all of the previous reports, preferably in a new worksheet in the same Excel file rather than a new Excel file each time.  I would like the worksheets to show some kind of identifier like a date/time stamp.

 

For example, the first time I run the macro, it would generate "REPORT.xlsx" with one worksheet called "2018-12-16 2048" (say for 10:48 PM).  The second time I run the macro using more current data from my company's system, it will add a new worksheet in the same Excel file "REPORT.xlsx", called "2018-12-17 0930" (say for 9:30 AM).

 

I'm very new to this so I don't even know if it's possible, but did a lot of searching online and couldn't find anything so far.

 

Thanks!

Highlighted
6 - Meteoroid

Is the date and timestamp captured in any field/column?

Highlighted
5 - Atom

Hi. Do you mean is there a date/time stamp in the original source report from my company's system?  Yes there is.  I think I'm able to extract data in the workflow - what would be the next step?  Thanks!

15 - Aurora

If I understand your requirement correctly, I would just create a new field with a formula tool like [fullpath] with a formula like this:

 

'c:\users\davidp\desktop\Report.xlsx|||' + tostring(datetimenow())

 

Change the path to wherever you want Report.xlsx written.

 

Then  use the Output Data tool and set 'Take filename from field' [fullpath] and uncheck 'filename in output'

 

Set the option to 'create new sheet'

 

This will create a unique new sheet with the current datetime every time you run the workflow.

 

 

Labels