Forum Discussion
How to create a TimeKey from a time column in hh:mm:ss format.
- 7 years ago
Hi,
Enter the Query Editor, click on your query, go to tab "Add Column" -> "Custom Column", enter column name and formula like code below, adjust the code by adding ",Int64.Type". Don't forget to click the "Close & Apply" button.
Time.Hour([Time])*60*60+Time.Minute([Time])*60+Time.Second([Time])
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi v-xicai , Unfortuantely thats not what i am after as i already have a time column!
I am trying to convert time from hh:mm:ss to seconds (wholenumber). This would then form a key to be joined to a time dimension table.
Hi,
Enter the Query Editor, click on your query, go to tab "Add Column" -> "Custom Column", enter column name and formula like code below, adjust the code by adding ",Int64.Type". Don't forget to click the "Close & Apply" button.
Time.Hour([Time])*60*60+Time.Minute([Time])*60+Time.Second([Time])
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.