Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Output data - using variables in the "Write to File or Database"

zammar
7 - Meteor

Hello -

 

I am hoping someone could direct me to the right place. I can't find any other reference (I know, someone will have a link to something similar) but I am sorry I did not find anything.

 

My question is: I have a variable/Column defined "File_Name" as "H:\tmp\Alteryx\tmp\"+[Cycle]+ " Test.xlsx|||Sheet1". I am trying to use it the 'Write to File or Database" field when outputting my data to excel.

 

When I use the same string "H:\tmp\Alteryx\tmp\Cycle 5 Test.xlsx|||Sheet1" in the "Write to File or Database" it works.

 

Thanks for your help!!!

 

 

6 REPLIES 6
StephenMack
10 - Fireball

Do you get any kind of error?

 

I tried a simple version of this and it seems to write a file fine with my hard coded location and with a generated location. If your [Cycle] variable is a number you may have to convert it to a string?

 

"C:\mypath\" + ToString([Cycle]) + " test.xlsx|||Sheet1"

cmcclellan
13 - Pulsar

At the bottom of the Output Data tool config you can change this:

 

2019-06-21 06_58_24-Alteryx Designer x64 - New Workflow1_.png

 

In the dropdown you will see your field called File_Name.

 

It's important to .... 

 

- check the box "Take File/Table Name From Field"

- change the dropdown to "Change Entire File Path"

- probably UNCHECK the "Keep Field in Output" 

 

zammar
7 - Meteor

The error i get says something about needing to name the file.

zammar
7 - Meteor

Thank you! That will work if I am renaming the entire file. However, I am using the feature you outlined below to generate multiple tabs containing other variable names. In other words, I have a column called Type that is saved as a separate sheet for each value. But I need to use column File_Name to save the entire name of the file containing another variables "Cycle" that is also calculated within the workflow. 

zammar
7 - Meteor

Did you put the expression in the "Write to File or Database" field in Output data tool? And it worked? I am getting an error that I must specify a sheet name.

 

 

2019-06-21_7-52-59.png

zammar
7 - Meteor

Adding "|||Sheet" at the end fixed it... It is running fine now.

 

 

 

 

2019-06-21_8-18-58.png

Labels
Top Solution Authors