I am new to the looker. Trying to write a custom field and getting this error. Any suggestions?
Solved! Go to Solution.
Yes, a year is an integer, date is a date, so you can’t compare it. Try
extract_years(${your_field}) = 2021
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!!