Hi,
I've searched this site and not found this already, so if I missed on my search, sorry.
I need to pass in a variable to a script, where the first three characters of that variable represent a calendar quarter, and the last 2 characters are the year. I.E. Q0105 for Q1, Q0205 for Q2, and so on. How to do this is not the question.
Inside the script, I need to pattern match on the first three characters to determine what quarter it is (technically I could match on the 3rd char only but it's easier to read and understand if I do all three - but not stuck on that).
The reason is I need to populate three other variables based on the quarter. The other variables represent the months, so for Q0105, I need to make M0105, M0205, M0305. For Q0405 I need to make M1005, M1105, M1205.
So, how do I read just the first three chars that are inside the input variable, to match it up to a quarter?
Thanks!