Hi
I have period date compose by 6 numbers, the first four numbers itβs the year and the last two is the month, example: yyyymm. (202201 )
The problem with this field is that sometimes changes between int and string. How can I change everything to a date format? dd/MM/yyyy
Max
2
First you would always cast to a string.
toString(date)
Then you would need to change this into a supported date format.
concat(substring(toString(date),1,4),β/β,substring(toString(date),5,7),β/β,β01β)
Finally you would parse this as a date.
parseDate(concat(substring(toString(date),1,4),β/β,substring(toString(date),5,7),β/β,β01β),βyyyy/MM/ddβ)
This would be the final calculated field ^
Let me know if that helps.
1 Like
Hi max!
Thanks for this solution!, I only need to correct this thing in the function
parseDate(concat(substring(toString(date),1,4),β/β,substring(toString(date),5,2),β/β,β01β),βyyyy/MM/ddβ)
1 Like