I connect to mysql server to visualize data into looker. I have column which has dates in text format. The table is as follow:-
property_id | year_month |
---|---|
2 | 2021_01 |
33 | 2021_01 |
356 | 2021_03 |
32 | 2022_04 |
I would like to convert this year month column to date, so that I can add date filter in my visual ... I am left with the impression that I should concat 01 as a day for that column and then parse date as follow
PARSE_DATE("%Y-%m-%d", REPLACE(CONCAT(year_month_extra, "_01"), "_", "-"))
I recieve error from the visual "inproper configuration"
Error with SQL statement: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month AS CHAR), CAST('01' AS CHAR)), '', '-'), '%Y-%m-%d') AS DATE) AS qt' at line 1
Could you please help? Thank you very much