EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB8721: How to convert a metric displaying number of seconds in an integer format to a "Timestamp" format in MicroStrategy Developer 9.4.x-10.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


How to convert a metric displaying number of seconds in an integer format to a "Timestamp" format in MicroStrategy Developer 9.4.x-10.x

A user may have a metric which is displaying number of seconds in the integer format, such as "1360" seconds, but they may want to convert it into a time stamp format, such as "0:22:33".
 
In order to achieve this, users can create another metric 'Timestamp of seconds' based on the metric 'Seconds'. This metric converts the number of seconds into hours, minutes and seconds. Also, this new metric will continue to total correctly when adding the timestamp values together. For example, the total of '1:06:40' and '0:12:40' will be correctly displayed as '1:19:20' and not '1:18:80'.
 
Consider the following example: If data of 'Seconds' is 4000, then the corresponding data in 'Timestamp of seconds' should be '1:06:40' (or, one-hour, six-minutes and forty-seconds).
 
Steps to create the metric:

  • Create the metric 'Timestamp of seconds' by using the following formula:
    (Metric`second` / (24*60*60))
  • Format the metric data by using a custom setting, ':mm:ss', as shown in the screen shot below:
ka02R000000kcXcQAI_0EM440000002G4i.jpeg
  • Execute a report with metrics 'Seconds' and 'Timestamp of seconds' and enable subtotal of report. The correct data will return as the following:
ka02R000000kcXcQAI_0EM440000002G4g.jpeg

 


Comment

0 comments

Details

Knowledge Article

Published:

April 14, 2017

Last Updated:

April 14, 2017