Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I get the below mapping in the data model?
For each As on Date, it should go back back to the last 4 quarters.
Here is an inelegant solution that should give you want you need:
Maybe with an approach like this one:
load *, dual('Q' & ceil(month(TargetDate) / 3) & ' ' & year(TargetDate),
monthstart(TargetDate)) as Quarter;
load SourceDate, addmonths(Date, (iterno() -1) * -3) as TargetDate
from Source while iterno() <= 4;