Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'd like to change the data type from number to timestamp.
I write like below, but it doesn't work.
"timestamp#(check_day)"
How can I change the number to date?
ex) 20230928112233 -> 2023/09/28 11:22:33
Thank you.
Try using the hash timestamp#(field, 'format') function to identify year, month etc from your field.
Second step use the "regular" timestamp(field, 'format') function and specify which format you wish to use.
Note the timestamp# function will convert the value to a dual with a numerical presentation and a text representation. The timestamp function can then be used to modify the text representation to whatever you want 🙂
EDIT: no need to wrap a numeric field with text actually..
t1:
Load
timestamp(timestamp#(number_timestamp,'YYYYMMDDhhmmss'),'YYYY/MM/DD hh:mm:ss') as formatted_timestamp;
load * Inline [
number_timestamp
20230928112233
];
Try using the hash timestamp#(field, 'format') function to identify year, month etc from your field.
Second step use the "regular" timestamp(field, 'format') function and specify which format you wish to use.
Note the timestamp# function will convert the value to a dual with a numerical presentation and a text representation. The timestamp function can then be used to modify the text representation to whatever you want 🙂
EDIT: no need to wrap a numeric field with text actually..
t1:
Load
timestamp(timestamp#(number_timestamp,'YYYYMMDDhhmmss'),'YYYY/MM/DD hh:mm:ss') as formatted_timestamp;
load * Inline [
number_timestamp
20230928112233
];
Thank you so much!