Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Copy historical data and append today's date

mtuwanax
7 - Meteor

Hi all,

 

I'm running a workflow that get's historical data, copies it and appends today's date to Run Date column as shown below, but am unable to make this workflow work. My data has the following format, any one know I can make this work? 

 

ItemValueRun Date
A1010/05/2021
A1011/05/2021
A1012/05/2021
15 REPLIES 15
mceleavey
17 - Castor
17 - Castor

Hi @mtuwanax ,

 

You need a formula tool to either create a new column, or replace Run Date with datetimetoday()

 

M.



Bulien

TheOC
15 - Aurora
15 - Aurora

hey @mtuwanax 

Just to check, you just need todays date appending as a field to rundate?

I've done that in the attached workflow, but only where rundate is null, so that it doesn't replace the current values.

TheOC_0-1620999865497.png

 



IIF(IsNull([Run Date]), DateTimeFormat(DateTimeNow(),"%d/%m/%Y"), [Run Date])

The key is to use datetimenow() to get the current date, and then format this as dd/mm/yy

Hope this helps!
TheOC


Bulien
mtuwanax
7 - Meteor

Hi @TheOC @mceleavey 

 

Thank you for your responses.

 

I realized that my question was not very clear. In my workflow, I ran a daily report to get the current month's data and append today's date as the run time to the excel workbook, which i've been able to achieve. My challenge is copy previous months' data and appending it to the workbook and adding the today's date as the run time to the historical data.

 

Hope the question is clearer now. I've built this workflow, but somehow it appends an excessive number of the historical data.

 

atcodedog05
22 - Nova
22 - Nova

Hi @mtuwanax 

 

Something you can do is read the historic data and append it with the new data using union tool. Later you can use to the formula to assign run date.

 

Example:

atcodedog05_0-1621007786281.png

 

Hope this helps 🙂 If not let me know how i can help you.

mtuwanax
7 - Meteor

Hi @atcodedog05 

 

Thank you for your response.

 

I'm afraid that your proposed solution wouldn't work for me, as I need to the historical data to contain the past run dates and today's run date. Ideally, I want to copy the old data, and create new rows using the old data and append today's date as the run date. e.g. if the historical data had 30 records on 13th May, then on 14th May, I want to copy the 30 records, append today's run date and have 60 records after saving the workbook.

atcodedog05
22 - Nova
22 - Nova

Hi @mtuwanax 

 

Just to clarify myself which of the below is correct.

 

on 13th may: you will have 13th may data (30 records)'

 

on 14th may: you want 13th may data (with old run date, 30 records) + 13th may data (with new run date, 30 records) + 14 may data (30 records)

=total 90 records

 

or

 

on 14th may: you want 13th may data (with old run date, 30 records) + 14 may data (30 records)

=total 60 records

dougperez
12 - Quasar

This helps you?

mtuwanax
7 - Meteor

Hi @atcodedog05 

 

this is the correct understanding: 

on 14th may: you want 13th may data (with old run date, 30 records) + 13th may data (with new run date, 30 records) + 14 may data (30 records)

=total 90 records

dougperez
12 - Quasar

I think now is your desired solution

Labels