How do you group by billing cycle month dates (e.g. 2021-03-03 to 2021-04-03) instead of calendar dates?

I am creating a report of number of transactions in the past nmonths group by billing cycle months instead of calendar months. Example for Cycle 04, the group dates will be as shown below.  Is there a looker function to do this or should we code this with SQL CASE?

Dates                                                  Count

2020-12-04 to 2021-01-03.                100

2021-01-04 to 2021-02-03                  80 

2021-02-04 to 2021-03-03.                 50

2021-03-04 to 2021-04-03.                 60

2021-04-04 to 2021-05-03                   70



This topic has been closed for comments