My title is a mouthful..i know. But please bear with me.
I am trying to figure out the best way to go about creating a column that needs to be created based on the number of rows in another column.
Here is what I mean..I have a column titled YearID, and there can be between 1-12 rows for each year ( you probably guessed it), this will represent the months. So I need to create another column next to the YearID to capture the Month. So if there are 4 rows for 2004, I need the MonthID column to show 1-4, and so on...
So I was thinking about looping through the YearID column, and as long as the year is the same then show a value depending on the number of rows...but I am not sure if this is the best way...it definitely is not the simpliest right now!
Any suggestions would be helpful!
I am trying to figure out the best way to go about creating a column that needs to be created based on the number of rows in another column.
Here is what I mean..I have a column titled YearID, and there can be between 1-12 rows for each year ( you probably guessed it), this will represent the months. So I need to create another column next to the YearID to capture the Month. So if there are 4 rows for 2004, I need the MonthID column to show 1-4, and so on...
So I was thinking about looping through the YearID column, and as long as the year is the same then show a value depending on the number of rows...but I am not sure if this is the best way...it definitely is not the simpliest right now!
Any suggestions would be helpful!