Forum Discussion
How to convert weird integer date and time values
Hi
If you know that 735920 equals 2015-11-18
Then 733904 must be 735920-733904 = 2016 days before
Then you could add a column in your query
= Table.AddColumn(PreviousStep, "Date", each Date.AddDays(#date(2015,11,18), [Process_Date]-735920))
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjc2tjQwUYrVATFNjAzNlWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Process_Date = _t]),
PreviousStep = Table.TransformColumnTypes(Source,{{"Process_Date", Int64.Type}}),
#"Added Custom" = Table.AddColumn(PreviousStep, "Date", each Date.AddDays(#date(2015,11,18), [Process_Date]-735920))
in
#"Added Custom"/Erik
Thank you for your help!
Apologies for the late response, but I got no notification from the forum.
I am not 100% sure how it works, but it works :)
But how can I convert the time fields?
Thank you in advance.
- donsvensen7 years agoSkilled Sharer
Hi
When you say time field do you mean the datatype date or ?
You can just rightclick the header on the table and choose Change type and pick date
or modify the addcolumn step
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjc2tjQwUYrVATFNjAzNlWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Process_Date = _t]), PreviousStep = Table.TransformColumnTypes(Source,{{"Process_Date", Int64.Type}}), #"Added Custom" = Table.AddColumn(PreviousStep, "Date", each Date.AddDays(#date(2015,11,18), [Process_Date]-735920), type date) in #"Added Custom"and specify the datatype as the last argument
/Erik
- Anonymous7 years agoNot applicable
Hi
No I mean the "Process_Time" from my source data. And the datatype should be Time, something like 07:15:00 instead of 33213.
Thank you for your help!
- v-cherch-msft7 years agoMicrosoft Employee
Hi Anonymous
You may refer to below to add a custom column.
Regards,
Cherie