Alteryx Designer Discussions

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

Creating a time series month on month by renaming columns

7 - Meteor

Hi there

 

I have a file that only shows last month data in the file but I also want to create a time-series file of trended data too. However the field that comes in the file each month is just called Actual YTD (and this name doesn't change month on month) and we know it's for that previous month. I am guessing I would need to rename that column before I output it in the trended file to be the month. How do I do this? How do I know which month it is.

What I have done so far is attached a dynamic rename and I renamed that field to DateTimeNow() but obviously Id want it to be last month. I then wanted to rename that column to the text version of the date eg. Sep-2018.

 

1. How do I rename that column to be called the last month (in date format or in text format)

2. If done in date format, how do I rename it back to the text format?

 

Thanks

Anjum

Alteryx Certified Partner

If you set the output format of the the DateTimeNow() tool to yyyy-MM-dd, then the following formula will give you the column name for the prior month.

 

ToString(DateTimeFormat(DateTimeAdd([DateTimeNow],-1,'Months'), '%b-%Y'))

7 - Meteor

Hi there,

 

I have attached my issue in a word doc, hoping you can help.

Alteryx Certified Partner

Here is an example using the formula that I mentioned.

Labels