Alteryx Designer Desktop Discussions

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

Adding timestamp to output CSV file

HA
8 - Asteroid

Hi,

In my workflow I get data from a database and also get a timestamp value from another database table append the timestamp field to the main dataset, then I use output data tool to generate a CSV file with the timestamp(I use Take File/Table Name from Filed option in the output file). Everything works fine as long as the output has at least one record, but there are some cases that the output has no record ( just the header row) and I still need to generate CSV with timestamp. When there is no record in the main dataset of course append tool doesn't append the timestamp field, but in such scenarios I won't get any output because output data tool looks for the timestamp filed to name the output file. Any suggestions how we can resolve this?

 

thanks,

  

6 REPLIES 6
MarqueeCrew
20 - Arcturus
20 - Arcturus

@HA,

 

I am attaching a sample (test) workflow that accomplishes the feat of producing a "No Record" output that can have a timestamp.

 

  • A text input tool is used to handcraft a "No Record" output
  • A Formula tool is used to create a timestamp 
  • A Union tool is used to combine all sets of data
  • A Count Records tool is used to count the incoming data records (0, 1 or many)
  • An Append Fields tool is used to put the count onto all records
  • A Filter Tool is used to either DELETE the No Records when the count is 1 or more or to keep the No Records data when the count = 0
(contains([Field1],'no data') AND [Count] ==0)

OR

(!contains([Field1],'no data') AND [Count] !=0)

Now you can output the data to your CSV format and get No Record when you have no data.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
HA
8 - Asteroid

Hi ,

Thank you for your reply. I use version 10 and I couldn't open your file. Would it be possible to save your file as version 10?

 

Thank you,

 

MarqueeCrew
20 - Arcturus
20 - Arcturus
https://gallery.alteryx.com/#!app/Modify-Alteryx-Workflow-Version/5773f9c33df7da0e58dc82d3

Sent from my iPhone
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
HA
8 - Asteroid

Thank you, but I have difficulty using your conversion tool. If you could just paste the screen snapshot so I know how to arranged the tools I can figure out the details. I really appreciate your help. 

MarqueeCrew
20 - Arcturus
20 - Arcturus

attached is a workflow that you can open.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
HA
8 - Asteroid

@

 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels