This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have a file where by we should yearly data on a month by month basis so every month a new month is added and thus becomes the last column. How do I always select the latest month, without specifying it somewhere beforehand. Our financial year runs from Oct-Sept so the new year will only show 1 month of data and then the following year will show 2 months and ect ect.
The Field Info tool lists out the names of the columns, then I use a RecordID, Sort, and Select Records to grab the last record (which is the name of the last field). In the top, I use a Transpose so I end up with the column names and values in two columns (with another RecordID to maintain which row each piece of data came from). Then I Join on the field names, Crosstab to get the data back in it's original format, and use a Select to drop the RecordID.
A little bit convoluted, but it's dynamic enough that it will always grab the last column in a dataset. Hope it helps!
Might be a silly question but what if I want to keep the original column and the new colum to be called 'Current Month', this way there's always the original columns in the file as well a duplicate of the current one