I have a data source in Looker Studio that includes a date field. I would like to set up a group to group these dates by semester/custom date ranges. I've tried Add a field > add group, but nothing happens when I select the date field from the data source. I have been able to add groups based on other fields in the same data source.
Am I not able to group by date? Or, is there a specific format for the date that should be used in the group value field? I've tried the date in a variety of formats, but nothing seems to work.
I'm having the same issue; I want to create custom months based on my company's fiscal calendar. I tried so many workaround using bins as well, nothing seems to work. Have you found a solution since the original post?
Has this been resolved? I'm experiencing the same problem in that I'm unable to create groups based on a date field.
This is still not resolved as far as I can tell.
Hi,
This method does not use the built in "Add Group" function but I use "Add calculated field" to group months into quarters as our fiscal calendar starts in August. Hopefully you can tailor this to your needs.
CASE
WHEN MONTH(YourDateField) IN(08,09,10) THEN 'Q1'
WHEN MONTH(YourDateField) IN(11,12,01) THEN 'Q2'
WHEN MONTH(YourDateField) IN(02,03,04) THEN 'Q3'
WHEN MONTH(YourDateField) IN(05,06,07) THEN 'Q4'
END
Also, if I want the months in a chart to be ordered so that August comes first, I use the following as a SORT field* for my charts: (*you need to have it aggregated as an average or max or min, NOT sum for the ordering to be in the correct order)
CASE
WHEN MONTH(YourDateField) = 08 THEN 1
WHEN MONTH(YourDateField) = 09 THEN 2
WHEN MONTH(YourDateField) = 10 THEN 3
WHEN MONTH(YourDateField = 11 THEN 4
WHEN MONTH(YourDateField) = 12 THEN 5
WHEN MONTH(YourDateField) = 01 THEN 6
WHEN MONTH(YourDateField) = 02 THEN 7
WHEN MONTH(YourDateField) = 03 THEN 8
WHEN MONTH(YourDateField) = 04 THEN 9
WHEN MONTH(YourDateField) = 05 THEN 10
WHEN MONTH(YourDateField) = 06 THEN 11
WHEN MONTH(YourDateField) = 07 THEN 12
END
This won't quite work for my purposes. I work with academic data, and unlike in the financial field, the academic field doesn't set its terms to a specific month, but rather dates. So, for example, this year our first semester ended 1/16/25; last year it ended 1/19/24, with the next semester picking up directly after that. Our quarters follow similar pattern,s where each year the first quarter ends around the middle of November, and our first two quarters make up the first semester, the third ends about a week before the end of March, and our last quarter/semester 2 ends around the first or second week of June. Finally, we have our less official summer terms where summer school and extended school year data is tracked. It's essential for us when tracking our populations to be able to do so by these set terms. This is such a common practice when looking at academic data, I'm really surprised that being able to set custom terms between specified dates isn't a built-in feature.
Okay, I deleted my previous post which contained a formula that did not work (!)- hopefully the below should work and allow you to specify dates. (I have put in some random dates for now).
CASE
WHEN (your date field) >= DATE '2024-01-01' AND (your date field) <= DATE '2024-03-31' THEN 'your group name 1'
WHEN (your date field) >= DATE '2024-04-01' AND (your date field) <= DATE '2024-06-30' THEN 'your group name 2'
WHEN (your date field) >= DATE '2024-07-01' AND (your date field) <= DATE '2024-09-30' THEN 'your group name 3'
WHEN (your date field) >= DATE '2024-10-01' AND (your date field) <= DATE '2024-12-31' THEN 'your group name 4'
ELSE 'Other'
END
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |