how can I transform a string column that has date and epoch format values into a date column? I'm working on a postgresql / Tableau prep environment.
Please find attached the example here
OK this query works:
SELECT case
WHEN len(d.properties__renewal_date__value) > 10
THEN (timestamp 'epoch' + CAST(NULLIF(d.properties__renewal_date__value, '') AS BIGINT)/1000 * interval '1 second')
ELSE to_date(d.properties__renewal_date__value, 'DD/MM/YYYY') end as renewal_date