Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
AnushaKarthik
Partner - Contributor
Partner - Contributor

Month to Quarter Mapping

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.

AnushaKarthik_0-1744119594358.png

 

Labels (2)
2 Replies
rdm6532
Contributor II
Contributor II

Here is an inelegant solution that should give you want you need:

rdm6532_0-1744120168353.png

 

marcus_sommer

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;