Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: How to format & display a measure which is in seconds to HH:MM:SS

78 views
Skip to first unread message

Deepak Puri

unread,
Feb 5, 2005, 9:59:01 PM2/5/05
to
This MSDN link discusses FORMAT_STRING options for cube measures:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/olapdma
d/agmdxadvanced_2aur.asp


This earlier post shows how to format hh:mm:ss

http://groups-beta.google.com/group/microsoft.public.sqlserver.olap/msg/
13d3af02580a7257
>>
From: Deepak Puri (d...@progressive.com)
Subject: Time format Measure
This is the only article in this thread
View: Original Format
Newsgroups: microsoft.public.sqlserver.olap
Date: 2004-04-24 21:53:31 PST

Try the following format, if time is < 32K seconds:

With Member [Measures].[FormattedASA] as
'TimeSerial(0,0,[Measures].[AvgSpeedAnswer])',
FORMAT_STRING = 'hh:nn:ss'
>>


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Ohjoo Kwon

unread,
Feb 6, 2005, 11:03:16 AM2/6/05
to
Siva,

If you mean "elapsed time in seconds", its format is not so easy and you
have to cosider more things because it does not point just "a point in
time".

If the elaspsed time is less than 24 hours, the next format is sufficinet.

WITH
MEMBER Measures.Elasped AS '<Seconds> * 1/60/60/24', FORMAT_STRING =
'hh:mm:ss'

If the elaspsed time is equal to or more than 24 hours, the elapsed days
must be also considered.

WITH
MEMBER Measures.hhmmss AS '<Seconds> * 1/60/60/24'
MEMBER Measures.days AS 'DateDiff("d", CDate(0),CDate(hhmmss))'
MEMBER Measures.Elapsed AS 'CStr(days) + " Days " + Format(hhmmss,
"hh:mm:ss")'

If your final format is more complicate, you also consider using your own
User Defined Function.

Ohjoo Kwon
www.olapforum.com

"Siva" <Si...@discussions.microsoft.com> wrote in message
news:3C8F43BA-A95B-4D70...@microsoft.com...
> Hi,
> I have a measure in seconds. Can any one tell me the mdx code to format
and
> display the measure which is in seconds to HH:MM:SS. Thanks for your help
> --
> Siva


Siva

unread,
Feb 7, 2005, 6:13:03 PM2/7/05
to
Thank you Deepu.

Siva

unread,
Feb 7, 2005, 6:15:04 PM2/7/05
to
Thank you Ohjoo
0 new messages