We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic Rename the most recent month

Alexo_142
5 - Atom

The data source is appending the most current month on to the end of my data every month. I need to sum the column of the most recent month. For example today i need to sum YTD May but this time next month i will need to sum YTD June. I would like the rename the most current month "current month and then Sum that. if you have any other ideas im open to that also

 

 

 

2 REPLIES 2
Pilsner
13 - Pulsar

Hello @Alexo_142 

Great question, if I've understood you correctly, you're trying to rename the column referencing last month, with the prefix "YTD ". Then sum the renamed column. I have tried to find an answer below:

 

For reference, I have used some dummy data based on the image you provided:
Screenshot 2025-06-18 171323.png

1) I started by using the formula tool to find todays date, minus one month. The function is:

DateTimeAdd(DateTimeToday(), -1, "Month")


2) Use the data time tool to extract out the 3 digit month (i,e Jan, Feb.....)

3) Prefix this month with the letters "YTD "

4) Create a column with the new column name in this case I chose "Current Month"

 

5) Drop unnecessary columns to get the following:

Pilsner_0-1750263810890.png

 

6) Feed this information, and the main data set, into the dynamic rename tool and configure it to take field names from right input rows:

Screenshot 2025-06-18 172559.png


This resulted in the following table:

Screenshot 2025-06-18 172655.png

 

7) Sum the column called current month.

 

Here is an image of the whole workflow:

Screenshot 2025-06-18 171536.png

 

I have attached a copy of the workflow below. Please let me know how you get on. 

Regards - Pilsner

 

binuacs
21 - Polaris

@Alexo_142 one way of doing this with the dynamic select tool

binuacs_0-1750266740553.png

 

Labels
Top Solution Authors