How can I find the start-period that is used in the current sample?
For example, when using the commands
Code: Select all
smpl 2020:3 2020
on a dated workfile on a quarterly, monthly, weekly, or daily frequency, I want to fetch the period "3" of that current sample. How can I do this in a robust way?
I believe I can use the command on a quarterly frequency:
Code: Select all
%tmp = @otods(1)
!start = @datepart(@dateval(%tmp), "Q")
but it does not work well on other frequencies. Any suggestions for a robust code that works across different frequencies?
Thomas