I have a column that shows sales and I have a column that shows sales date. I am trying to create a filter that allows me to filter the sales column for two weeks ago. I was trying to create a custom filter on the field using syntax like
DATE_SUB(DATE_TRUNC(CURRENT_DATE(),week), INTERVAL 1 Week) > ${Transaction_date}
and
DATE_SUB(DATE_TRUNC(CURRENT_DATE(),week), INTERVAL 2 Week) <= ${Transaction_date}
Every time I try this I get an expression incomplete error. Any suggestions would be greatly appreciated!
Hi rlee,
Add your date dimension as a filter, and then select the “Matches (Advanced)” option. Type in:
2 weeks ago for 7 days
and Looker will take care of translating this into SQL for you. Check the Looker documentation on Filter Expressions for more info!