Just tested it and the code I put in my prior post works. Ive updated it to match the field name used in your example.
if REGEX_Match([Date], '\d{5}') then todate(tonumber([Date])) elseif regex_match([Date], '\d+-\d+-\d+') then datetimeparse([Date],'%Y-%m-%d') else null() endif
I am getting Malformed if statement with this formula, my incoming date column data type is V_string and the new output datatype is date. Kindly guide where I am facing the problem.
You might not have copied the entire code? I have the same settings.
As soon as I am typing '\d{5}' it starts throwing error 'Malformed if statement'. Can I know the reason ?
I had the same issue, but if you finish the complete statement it will work. Copy and paste from my prior two posts. If the name of the Date field is different, update the field name.
User | Count |
---|---|
107 | |
82 | |
70 | |
54 | |
40 |