Is it possible to write layouts to an Excel file? How can we achieve that?
I am currently writing to an Excel file that contains multiple tabs. Before preparing the tables, I want to add pivot tables in one of the tabs.
can anyone help with a poc?
Hello,
Attached is a workflow to write layouts into an Excel file.
Unfortunately, Alteryx does not natively have the capability to create an 'Excel Pivot Table' in the output file. You can perform the same actions as a pivot table utilizing the Transform Tool palette. If you must have a pivot table, you can add it manually after exporting or utilize python post excel creation.
I frequently do this as follows:
step1. Prepare an excel file that meets your demands. Create the pivot tables and data tabs with mock data, test everything, and save this template (EMPTY) somewhere safe.
step2. Use a run command to copy the empty template to the location where you want it to be. Create a command in flow that looks like this:
'copy "C:templatefolder\emptytemplate.xlsx" "C:outputfolder\yourpivotreports.xlsx"'
Make sure the run command receives only one line and one field containing the command.
step3. output your into the data tabs of your freshly copied template, either using separate output tools (mind sequencing though, because the file gets locked during writing) or using a field with full output path (and sheet!), set your output tool to "overwrite sheet or range". If you want formatting on your data tabs, you have to add a range to the filepath and sheet and set the output tool to "preserve formatting".
step4. I recommend using proper sequencing using control containers.
Good luck, let me know how you succeeded!