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
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:
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:
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:
This resulted in the following table:
7) Sum the column called current month.
Here is an image of the whole workflow:
I have attached a copy of the workflow below. Please let me know how you get on.
Regards - Pilsner