Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unable to Create customer expression for date

Hello All,

I am trying to create the following customer expression in Looker and getting the error expression is incomplete. Kindly help review the code. The Date and SL are dimensions and measures in the query.

Day before yesterday

if(${Date} = date(now()) - 2, ${SL}, null)

Yesterday

if(${Date} = date(now()) - 1, ${SL}, null)

Previous week

if(${Date} >= week_start_date(now()) - 7 AND ${Date} <= week_end_date(now()) - 7, ${SL}, null)

Week to Date

if(${Date} >= week_start_date(now()) AND ${Date} <= now(), ${SL}, null)

Previous month

if(${Date} >= date(now(), month_start_date()) - 1 month AND ${Date} <= date(now(), month_end_date()) - 1 month, ${SL}, null)

Month to Date

if(${Date} >= date(now(), month_start_date()) AND ${Date} <= now(), ${SL}, null)

Previous quarter

if(${Date} >= date(now(), quarter_start_date()) - 1 quarter AND ${Date} <= date(now(), quarter_end_date()) - 1 quarter, ${SL}, null)

Quarter to dateif(${Date} >= date(now(), quarter_start_date()) AND ${Date} <= now(), ${SL}, null)

0 0 56
0 REPLIES 0