Forum Discussion
Calculate Time over multiple months
- 6 years ago
Its not that simple 🙂
You can do it in number of steps.
- Change your time column to text format. So it will look like normal time format but its text 00:04:00
- Split by delimiter :
- You will have 3 columns (One for HOURS, second is MINUTES and third is SECONDS) change type to WHOLE NUMBER
- From Add Column tab select CUSTOM COLUMN, name this column CustomH
- HOURS * 3600 (thats number of seconds in one hour)
- From Add Column tab select CUSTOM COLUMN, name this column CustomM
- MINUTES * 60 (number of seconds in one minute)
- From Add Column tab select CUSTOM COLUMN, name this column TimeInSeconds
- CustomH + CustomM + SECONDS
- Close & Apply
Now you converted your time into seconds =D
Then create new measure and copy and paste my logic but just use your table name and column name.
Hope it clear now.
Abduvali
No, the code is for a MEASURE.
In Edit Query mode find your time column and convert it to secods!
Do you know how to achieve the following???
If yes, then just use that TimeInSeconds column in the code provided below: (this code you will use to create NEW MEASURE in the report view)
Avg Time =
Hello Abduvali,
I have removed all of my old formatting to start from the beginning.
Now I converted my time column into the "time" format. I don't see anywhere to convert it to seconds? Under "Date & Time Column" I can choose Seconds, but that only extracts seconds from the time.
Am I missing something here?
- Abduvali6 years agoSkilled Sharer
Its not that simple 🙂
You can do it in number of steps.
- Change your time column to text format. So it will look like normal time format but its text 00:04:00
- Split by delimiter :
- You will have 3 columns (One for HOURS, second is MINUTES and third is SECONDS) change type to WHOLE NUMBER
- From Add Column tab select CUSTOM COLUMN, name this column CustomH
- HOURS * 3600 (thats number of seconds in one hour)
- From Add Column tab select CUSTOM COLUMN, name this column CustomM
- MINUTES * 60 (number of seconds in one minute)
- From Add Column tab select CUSTOM COLUMN, name this column TimeInSeconds
- CustomH + CustomM + SECONDS
- Close & Apply
Now you converted your time into seconds =D
Then create new measure and copy and paste my logic but just use your table name and column name.
Hope it clear now.
Abduvali