I am needing to show the number for today and yesterday for a specific dimension. I have a measure already for current day value I am trying to get the value for “yesterday” but I cannot do what I thought would work:
add_days(-1,now( )) but this is an causing an issue.
Hi @brittany_juarez,
I can suggest 3 ways to approach this:
measure: sum_dimension_today {
type: sum
sql: ${my_dimension};;
filters: [date: "today"]
}
measure: sum_dimension_yesterday {
type: sum
sql: ${my_dimension};;
filters: [date: "yesterday"]
}
matches_filter(${dates.day_date}, `today`)
OR
matches_filter(${dates.day_date}, `yesterday`)
add_days(-1,trunc_days(now( )))
Hope this helps you!