how to mix different argument types in looker custom field

I am new to the looker. Trying to write a custom field and getting this error. Any suggestions? 
 

9abf1830-ca5b-45cb-a63d-1323224c2e07.png
Solved Solved
0 6 660
1 ACCEPTED SOLUTION

Yes, a year is an integer, date is a date, so you can’t compare it. Try 

extract_years(${your_field}) = 2021

View solution in original post

6 REPLIES 6

The field you selected for comparison is not a number, it’s a date. You can’t compare a number with a date, hence explain what you want to do and show us what the data looks like

Hi Dawid,

Thanks for your response. 2021 is an year. Should I write it in some other format?? 

What about the left side of the equation. Your field is a date, isn’t it? What are you trying to achieve?

It says if the year is 2021 then give yes else no. Is year different from date?? 

Yes, a year is an integer, date is a date, so you can’t compare it. Try 

extract_years(${your_field}) = 2021

It worked. Thank you so much Dawid!!

Top Labels in this Space
Top Solution Authors