How can I specify a month filter for a date dimension group?

I have a number of date dimension groups which are great for representing flexible date reporting.

The problem however is that when I select a filter for it, the filter is always represented by the full dd/mm/yyyy format.

E.G.

Start Date = 01-01-2022

Start Date Month = 2022-01

Filter selected requires specific day input, cannot select a specific month without defining a range .

0fe3d1fd-3249-4a8d-aa35-24b3f5157f3f.png

If you could possibly help me I would be greatly appreciative.

Kind Regards,

Connor

Solved Solved
0 3 4,231
1 ACCEPTED SOLUTION

leobardor
Participant V

Hi Connor!

Please check this example that I think it will help:

1.- Make sure we are using a dimension group working properly (Apply CAST functions of your SQL Dialect  if needed)

1c9b88ae-db7f-4321-b7f9-e286a8ec0df5.png

2.- Locate the dimension group created  and select month option

0799d4f4-9a58-49d4-a65c-777ed4356e68.png

3.- Customize the selection depending on your requirement

612dcbc6-1da9-42df-a111-083388331d13.png

4.- Example of the filter generated:

747adca5-e16a-4c96-b6ed-cc3c1961c379.png

Hope this helps!

Best regards,

Leo

View solution in original post

3 REPLIES 3

leobardor
Participant V

Hi Connor!

Please check this example that I think it will help:

1.- Make sure we are using a dimension group working properly (Apply CAST functions of your SQL Dialect  if needed)

1c9b88ae-db7f-4321-b7f9-e286a8ec0df5.png

2.- Locate the dimension group created  and select month option

0799d4f4-9a58-49d4-a65c-777ed4356e68.png

3.- Customize the selection depending on your requirement

612dcbc6-1da9-42df-a111-083388331d13.png

4.- Example of the filter generated:

747adca5-e16a-4c96-b6ed-cc3c1961c379.png

Hope this helps!

Best regards,

Leo

Hey @leobardor,

Thanks so much for that, I’m almost certain I had looked exactly there before and didn’t see anything specific to a month.

Did I need to declare it in the definition of the filter first?

Thanks for pointing me back there anyway, it seems to work as expected now :grin:

Kind Regards,

Connor

leobardor
Participant V

Hey @leobardor,

Thanks so much for that, I’m almost certain I had looked exactly there before and didn’t see anything specific to a month.

Did I need to declare it in the definition of the filter first?

Thanks for pointing me back there anyway, it seems to work as expected now :grin:

Kind Regards,

Connor

Hey Connor,

Yo are welcome! First generate the dimension group in the view that is going to be used in the tile, save LookML code and then add the filter in the dashboard section.

I suggest testing the data field in the explore section just to make sure it is working as expected (datetime field) Sometimes we need to convert a string field to date, in that case, we need to make sure this conversion is working right in looker explore . I usually check this part of the explore to determine if looker is using the field as date:

4848f776-3d9a-4bfd-a45c-270565762b09.png

Best regards,

Leo

Top Labels in this Space
Top Solution Authors