Solved

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

  • 8 March 2022
  • 3 replies
  • 748 views

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 .

 

 

 

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

 

Kind Regards,

Connor

icon

Best answer by leobardor 8 March 2022, 17:12

View original

This topic has been closed for comments

3 replies

Userlevel 2

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)

 

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

 

 

3.- Customize the selection depending on your requirement

 

 

4.- Example of the filter generated:

 

 

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

Userlevel 2

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:

 

 

 

Best regards,

Leo