community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Workflow querying weekly data dynamically and stores in output filename_StartDt_EndDt.csv

Hello Team,

I have a requirement where I need to built a workflow that should run weekly and stores the data in csv file with filename as FileName_StartDate_EndDate.

for example, If I run the workflow today, Aug 14th, I should get two files:

FileName_08-01-19_to_08-06-19.csv

FileName_08-07-19_to_08-13-19.csv

Asteroid

This may help 

create   2 sets of  start and end dates   using  current date  and  datetimeadd function 

use these date to create  2 file names 

use   'take file/table name from field' option  in output tool 

I have taken start date in StartDate text input with 2019-08-01, FinalDate as DateTimeToday() and a loop StartDate <= FinalDate, EndDate as DateTimeAdd(StartDate,6,'days').

I am able to get data filtered on the basis of StartDate and EndDate.

The problem is I want the output file to be FileName_StartDate_EndDate.csv. How can I reusue StartDate and EndDate values to append in the file. I tried using formula tool but I dont know how to call StartDate and EndDate in it so that I can use it in outputfile name

Alteryx
Alteryx

Hi @PoojaPrasad,

 

have you tried this option below in the Output tool? You can construct your file name using the formula tool, appended to the data set that you want to output and use this option below to generate the file name dynamically.

This also allows you to generate multiple files with different names using the values from a Field.

 

More on that here: https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Output-Data/ta-p/30023

clipboard_image_0.png

 

Hope this helps!

Giuseppe

Yes, I am using the output tool as you have suggested. The issue is that the start date and end date are not the fields in my query. I have data for each day and I have where clause based on start date = 2019-08-01 and end date as start date +6 as shown in the below image.

 

clipboard_image_0.png

 

I have also used formula tool to add AppendFile to be used in the file. I need the file name as 'FileName_StartDate_EndDate.csv' but I am not able to get values of start date or end date after the dynamic input.

Asteroid

The  'append fields' in join category can be used  add  any fields  to all  rows  after  dynamic input  .

Labels