month over month help

i want the same period of days on a different month on looker

for example, im comparing November 1-4(bc 4th is today) and august 1-4

and tomorrow is going to be 5 so, nov 1-5 and august 1-5

is it possible?

1 REPLY 1

Hello Panalyst,

I recommend creating using looker's day_of_month datatype to support this type of filtration.  Please see the below example. 

With this, users will be able to easily filter to created_day_of_month_less_than_current_day_of_month = yes.


dimension: created_day_of_month {
type: date_day_of_month
sql: ${TABLE}.created_at ;;
}
dimension: current_day_of_month {
hidden: yes
datatype: date
type: date_day_of_month
sql: current_date() ;;
}
dimension: created_day_of_month_less_than_current_day_of_month {
type: yesno
sql: ${created_day_of_month}<${current_day_of_month} ;;
}

Users could also use this new yesno field in other interesting ways beyond filtering, for example:

month over month result.png 

I hope that helps. 

As you hit more scenarios / requirements relating to comparing between specific/custom periods, you may find it helpful to review these articles on various methods for period over period: