Forum Discussion
Summarising days/hours/mins
- Anonymous5 years ago
Hi khaycock ,
Will you consider to create a measure instead of a column?
Measure = var minu = SUM(tickets[ticket time]) var hours = INT(minu/60) var days = INT(hours/24) var remainmin = MOD(minu,60) var remainhours = MOD(hours,24) return days&" days, "&remainhours&" hours & "&remainmin&" minutes"Best Regards,
Jay
- Anonymous5 years ago
Hi khaycock ,
The only thing you need to do is to replace sum() to average().
And if you want a whole number, you could add int() before mod().
Refer:
Measure 2 = var minu = AVERAGE(tickets[ticket time]) var hours = INT(minu/60) var days = INT(hours/24) var remainmin = INT(MOD(minu,60)) var remainhours = MOD(hours,24) return days&" days, "&remainhours&" hours & "&remainmin&" minutes"Best Regards,
Jay
Hey khaycock ,
what do you mean it doesn't summarize?
The time should summarize depending on your filter context. Then at the end you return a text string with the summarized days, hours and minutes.
Or where are you struggling?
Sorry that I wasn't clear! I basically want to show a card that summarises all our tickets and shows how many days/hours/minutes a type of ticket has taken within a month. I can get the days/months/years to show on a line-by-line basis but when i summarise to a ticket type level, it doesn't work due to it not being able to sum.
I also have a card which shows the average time a ticket took to close which is currently in a decimal number based on number of days, but would rather this showed as days/hours/mins too