How to format duration in seconds as HH:MM:SS in an analysis?

Oracle BI 11g (11.1.1.5.0)
You would think it would be simple.
I have a measure which is a duration in seconds. All I want to do is to display this on an analysis in the format HH:MM:SS. But there appears to be absolutely no way to do this!!!
There's the custom numeric format [FMT:time(hour)] which displays seconds since midnight as HH:MM:SS, but this doesn't work for duations longer than 86400.
I've tried using the EVALUATE function to directly call a database function called F_S2HMS which returns the correct format as a VARCHAR. However, Oracle struggles to aggregate this as it's a varchar and not an integer, which means that I can't include sub-totals in the analysis. => It reports the "cannot function ship the following expression..." error.
It seems the only option I have left is to specify the measure as an expression such as the following:
CAST(floor("Duration (secs)" / 3600) AS VARCHAR(4)) ||':'|| CAST(FLOOR(MOD("Duration (secs)" , 3600 ) / 60) AS VARCHAR(2)) ||':'|| CAST(MOD("Duration (secs)" , 60) AS VARCHAR(2))
This kinds of works - although the sub-total isn't formatted very nicely, and I get "::" where there's no duration. I also somehow think that this isn't going to be very performant.
I've even tried the column CSS and HTML options - but it seems these can't help either. I only succeeded in finding the bug whereby the "Contains HTML Markup" option has no effect in pivot tables (although it works in non-pivot tables).
Please help!
Surely there must be a simple way of setting the final display format of a column in the way I need?

Hi,
Try the below,
CASE WHEN LENGTH(CAST(FLOOR(sum("Duration (secs)")/3600) AS CHAR))<2 THEN '0'||(CAST(FLOOR(sum("Duration (secs)")/3600) AS CHAR)) ELSE (CAST(FLOOR(sum("Duration (secs)")/3600) AS CHAR)) END ||':'|| CASE WHEN LENGTH(CAST(FLOOR(MOD(sum("Duration (secs)"),3600)/60) AS CHAR))<2 THEN '0'||(CAST(FLOOR(MOD(sum("Duration (secs)"),3600)/60) AS CHAR)) ELSE (CAST(FLOOR(MOD(sum("Duration (secs)"),3600)/60) AS CHAR)) END ||':'|| CASE WHEN LENGTH(CAST(FLOOR(MOD(MOD(sum("Duration (secs)"),3600),60)) AS CHAR))<2 THEN '0'||(CAST(FLOOR(MOD(MOD(sum("Duration (secs)"),3600),60)) AS CHAR)) ELSE (CAST(FLOOR(MOD(MOD(sum("Duration (secs)"),3600),60)) AS CHAR)) END
Thanks,
Balaa...

Similar Messages

  • How to get MM:SS format in to seconds?

    I need to get MM:SS-format in to secs? How?

    Alexander_Wolff wrote:
    A second possibility is: go to the inspektor-panel and chooes format "duration". Pick the slider and set it to mm:ss.
    Now: pick the left edge of the slider and drag it to the right. Now the duration changes from "xx:xx" to "xx". This works with the right edge too. When you expand the slider you get "xx:xx:xx".
    Regards,
    AW
    AW,
    It is good to keep your suggestion in mind for those occasions when fractions of seconds aren't needed, and for when you want to stay in the Duration value type.
    Your suggestion and mine are quite different, but in some cases either may suffice.
    Jerry

  • Hundredth of a second ,how to format?

    How do I find the hudredth of a second, Timestamp is giving nano second and the SimpleDateFormat can format date to seconds or milliseconds, but I didn't find hundred of a second, I need to format date as hh:mm:ss:HH(HH is defined as hundredth of second in my requirements).
    thanks,
    Sujatha.

    Capital S is indicating millisecond in
    SimpleDateFormat, I checked the API.
    any more hints?If you are checking the API, there is a method relevant to your needs in the Timestamp class. It would have been much faster looking yourself than fishing for hints.

  • How to format new hard drive for Apple TV when you can't use old HD

    I need to know how to format a new HD to install in my Apple TV where I can't use the old HD to clone or otherwise create the new structure on the new HD.
    I have an Apple TV that was syncing to a Mac Mini that had a defective HD and logic board. I was unable to backup the Apple TV to the Mac Mini for some time before I had the mini repaired by AppleCare.
    When the mini came back, it registered on the Apple TV as a new computer and I couldn't sync with it without losing hundreds of dollars of content.
    All was okay until the other night when Apple's defective update for the ATV erased ALL my content. I updated it to 3.1 this morning, which Apple indicated might fix the problem. It didn't. The old content is all gone.
    My ATV is out of warranty, so I removed the old HD and copied the files from the "Purchased" folder to my mini. That saved most 101 items that I purchased since 12/08 (but not all for some reason). I lost all content prior to 12/08 that I purchased, as well as some content since 12/08 that I purchased.
    I need to keep the old HD untouched until I can purchase data recovery software. I'd like to just put a spare IDE HD in that I have into the ATV and just start over with what is in my Mac mini iTunes.
    So, how does one do that? I'm not gifted with vast Unix knowledge or experience and I don't want to clone the old HD and risk losing more data if it writes to the HD for some reason.
    Thanks.

    Hi Atagahi,
    Firstly, have you emailed Apple iTunes support indicating your issue? There have been instances in which Apple will allow re-downloading of all content you've purchased on the iTunes store.
    Secondly, I highly recommend you get an external usb hard drive, attach it to your mini and use it as a Time Machine drive to keep your iTunes purchases safe. It's a fact of life that all hard disk drives will eventually fail. The Apple TV should never be used as any kind of permanent storage space; think of it as a 'temporary holding' zone. And as you've unfortunately already experienced, a glitch wiped out all content on the Apple TV.
    As regards your original question, it seems like there have been folks who've done just that...taken the internal drive in the Apple TV out and attached it to a mac and copied files from the Apple TV hard drive. I have not had to do such, so I cannot offer any help here except for Linda's suggestion on googling the net for solutions.
    Good luck and hope you get all your purchased content back Atagahi!
    Message was edited by: Alec

  • How do I connect a second LaCie drive to my iMac 24"

    Hi, Im new at this and would like to know how do I connect my second 1TB LaCie drive to my 24" iMac. Im not sure if I need to connect it directly to my current LaCie drive since my iMac does not have a second firewire 800 port. Also, should I disconnect the old one to format the new one before?

    Oh..Ok, but to format the new one do I need to disconnect the old one and then connect the new one to the iMac before doing the daisy chain? Also, can Time Machine run both at the same time? Right now I have the Time Machine backing up my entire computer on the old LaCie, I want to use the new one to place my iPhoto library and all of my RAW images from my photography clients so I can free up space in my iMac.

  • How do I access new second hard drive?

    Hi! I am newbie, I am sorry if this a dumb question...
    How do I access my second hard drive?
    This is what I have:
    SparcStation5 170Mhz, 192MB memory.2HDD (one 4.3GB w/ OS, second Hdd 4.3GB)
    I had my sparc working with Solaris 8 just perfect!
    I added the second hard drive, no problems, I formatted the HDD from withing Solaris OS, (I can probe-scsi from openBoot promt and it showes OK), everything is OK so far, I can see the send hard drive using format, I can partition it and create slices on it, everything seems to be OK, I have no problems making partitions and everything on that Hdd. But when I try 'ls', I can't see anything on that disk, any suggestions? I tried several ways from my manual/book, including mount and it reads 'no acces point on mount' or somthing like that.
    this is what I see from format command:
    disk 0. (seegate 4.3GB.....) this is my new hard drive (already formated and partioned, I created a new partition /usr with 3.75GB on partition 6. Partition 3 is used by the hdd with a totoal of 4GB . this shows as c0t1d0
    disk 1. (SUN4.2GB) this is the hard drive with the OS Solaris 8. this is c0t3d0
    Am I missing something?
    Thanks!
    Murillo

    hi there ...
    read below--
    Find out the address of the drive
    STOP+A
    At the OK prompt, type probe-scsi. This will list all scsi devices on the system. Find the new drive.
    Type boot -r so the OS will see the new drive.
    Login as root and type format. Pick the new drive. The drives are listed as c(controller #)t(scsi id or target #)d(disk #). Label drive is required (it will tell you if the drive is not labeled).
    Next, type partition. Partition the drive as required (always leave partition 2 as the whole drive as it is informational to the OS
    Type print to list the current partitions. When you are done making changes type label
    To return to the OS prompt, type quit twice
    newfs /dev/dsk/DRIVE-ADDRESS
    (ie c0t1d0s0) (controller 0 target(ID) 1 disk 0 slice(partition) 0).
    mkdir directory, where directory is the directory you want to mount the drive on
    (ie, /disk2)
    mount /dev/dsk/DRIVE-ADDRESS directory
    Add the new drive to your /etc/vfstab file.
    (ie. /dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 /disk2 ufs 1 yes - )

  • How do I get the second HD to be a shared network drive??

    PowerPC G5 / dual 2Ghz - used as our file server.
    running OS X Server - v.10.3.9
    Have one internal HD - 160GB partitioned into two drives (General Access & Archive) in the Public folder of this computer
    Appears as Network: Local / G5 Server. When you click the connect button you get a choice of which volume to mount/connect to (ie. General Access; Archive or both)
    Running out of space on the drive so I purchased a second 160GB HD. Installed it, formatted it (with DiskUtility), named it, and copied all files from Archive (partition)
    The thought is to make this new 160GB drive Archive and to remove the partition from the original 160GB HD and have that be just General Access.
    How do I get the second HD to be a shared network drive??
    Also can I remove the partition to the first without having to clone it and reformat?

    Roam & Ali B,
    Thanks!!
    Next dumb question(s).
    We have a laCie FW external HD that I was using as a back-up drive (temporarily)
    I do have some files on it that I have to bring back onto the server to use. I get a admin user&passsword prompt every time I have to copy something back. It usually copies over a locked file that can only be deleted from the Server terminal.
    1. Why isn't this working without the admin prompt? I used DiskUtil to format it before I could use it.
    2. How exactly do I "clone" the current content - its not a simple 'Select All' and drag&drop? Is it going to bring over the partition as well??
    3. Once I have everything on the FW HD, re-boot using it as the System, and re-format the original 160GB HD - will I run into #1.

  • How to format programming source-code in a Framemaker document?

    I have to write up a technical document in Framemaker that explains various programming source-code.
    So my document consists of a bunch of text, followed by a bunch of source code (Java, XML) and then followed by more text, etc.
    What I'm confused about is how to format source code as part of my document. Has anyone done this for a technical document and come across any instructions or tips? So far my Googling hasn't produced anything relevant to what I need to do.

    If you haven't created a paragraph format that uses a fixed-width font, such as Courier or a console font, you need to do that.
    If you want to preserve line breaks in the code, and if it has fairly long lines, you're likely to need to specify a font size of 7 pt. or so. For really long lines, you may need to go to a landscape page format or incorporate a way of telling your readers that the lines wrap.
    Those are the basics. If you want to get fancier, I usually set up a table so I can apply a contrasting background tone, and format each line of code as a cell (it's a one-column table). You can also add a second column to hold line numbers, if you want.
    Art

  • How to format code properly in Visual Studio 2013 express

    <li><img id="img5" class="sm-im" src="img/elephant.jpg" title="click to enlarge" /></li>
    <li><img id="img6" class="sm-im" src="img/crow.jpg" title="click to enlarge" /></li>
    <li><img id="img7" class="sm-im" src="img/catdog.jpg" title="click to enlarge" /></li>
    <li><img id="img8" class="sm-im" src="img/kangroo.jpg" title="click to enlarge" /></li>
    <li><img id="img9" class="sm-im" src="img/eagle.jpg" title="click to enlarge" /></li>
    http://i.imgur.com/wqVb0LI.png?1?2818
    How to format code properly in visual studio, like we can see that the initial <li> moreover img idand class are
    properly aligned and can be easily changed using click+alt, but the second highlighted portion (in brown ) is not aligned i.e. the closing </li> tags
    should be in one straight line. Moreover 'title' should be in one straight line. How to make that possible.

    Hi Nobele,
    Thank you for posting in MSDN forum.
    Since this forum is discuss the VS IDE issue, based on your issue, I’m afraid that it is not the correct forum for this issue.
    To help you find the correct forum to support this issue, could you please tell me which kind of app you create in VS IDE? Is it a web application in the VS?
    (1)If yes, I suggest you can ask this issue directly to the ASP.NET forum:http://forums.asp.net/ , maybe you will get better support.
    (2)If no, please tell me more detail message about the issue.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to format my MacBook Pro?

    How to format my MacBook Pro? I want to format my mac, help.

    Restart with the Command and R keys held down, use the Disk Utility on the recovery partition to erase the main one, and install a new OS.
    (76312)

  • How to format my macbook pro and I dont have my lion cd or usb stick?

    How to format my macbook pro and I dont have my lion cd or usb stick?

    try this
    http://support.apple.com/kb/HT3294http://support.apple.com/kb/HT3294
    http://support.apple.com/kb/TS4265http://support.apple.com/kb/TS4265
    If you don't have the original PSWD, your beat, so tough if your a kid trying to be a kid

  • How can I open a second window in iTunes?

    When I see some albums in the the iTunes Store I want to check whether I have some of the songs already. The Search function in the Store only refers to the store and not to my Library. So how can I open a second window in iTunes (one with the Store and one with my Library) to make it easier to compare?
    Thanks

    My understanding it that was removed from iTunes recently (I still run iTunes 7.5 from 2007), so no, not unless you downgrade iTunes (which is not easy).  You can send feedback to Apple about reinstating it but I have yet to see Apple reinstate something that appeared to have been deliberately removed from its software, despite vociferous complaints on this forum.
    http://www.apple.com/feedback/itunesapp.html

  • How to set up a second iphone/itumes account on one computer

    Hi,
    I have iTunes on my windows laptop and my iPhone and my iTunes account is currently set up on my iTunes.
    I want my partner to also be able to have her own iTunes account and iPhone on my laptop.
    I have read a few forums but I cannot follow any of the instructions. The steps outlined are not available on my iTunes program. for example on apple suppor it says
    Windows users
    Look in your computer's Help documentation to learn how to set up other user accounts. To find this information:
    Click the Start Menu and click Help or Help and Support.
    Enter "new user" in the Search field.
    Press Return.
    when I go to my iTunes and go to help my options are "iTunes help" or "Apple service and support" and neither of these option allow you to search for "new user" so these instructions are useless.
    Can someone please give simple step by step instructions

    You seem to know alot, so I am contacting you regarding my query
    I bought a second iPod touch for my daughter. My problem is that this second iPod is not being recognized as a device... therefore I cannot sync it or add any content to it. Do you know how I can add a second iPod to my iTunes so that I am able to sync it?
    I have gone through all of the troubleshooting (restarting iPod, restarting computer, reseting iPod to factory default...etc). Can you please help me?

  • How do i add a second itunes account on same email

    How do i add a second itunes account on the same email address?

    Create a new AppleID (or use a different one if you are already doing so), then sign onto the iTunes Store that way and set up payment etc.
    There's many other aspects to this question, including if you want this all to go to the same library, the same user account on the computer, etc.
    Warning: For the purposes of redownloading items (make sure you understand redownload vs. first time download) you can only change primary AppleID associated with a computer every 90 days.  For other things such as buying new items there is no restriction.
    Items purchase under one account cannot be transferred to another.  you will still always have to use the old ID for any purchase you made under that ID.

  • Purchased a second iphone need to create an account, however the computer already has an itunes account...How do I create a second  account using one copy of itunes on a computer??

    Purchased a second iphone need to create an account, however the computer already has an itunes account for the first iphone...How do I create a second  account using one copy of itunes on single computer??

    Why do you need a new account?
    Use the same account on both.
    How to use multiple iPods, iPads, or iPhones with one computer

Maybe you are looking for

  • Empty cartridges?

    We have an HP LaserJet Pro color MFP M276nw.  We have allowed the color cartridges to run down as we do very little color copying.  SUPPOSEDLY the printer is designed to use only the black when the color cartridges are empty.  But we have been experi

  • InDesign CS5 -- dynamic charting workflow?

    Hi, I searched the forum but I feel like I haven't quite found my answer.  Basically, my organization, in the past, has produced a dynamic 'demographic fact sheet' document for communities in the Denver, Colorado USA region. (example: http://www.drco

  • Probelm with Printing FP image

    i want to print the FP of a VI multiple times and generate a PDF document. Before: i have used the following options. VI Properties >> Print Options >> Print with Execution     => this creates 3 pdf documents (on printing 3 times) instead of one. VI

  • Can't input MIDI file into project

    Hi, I can't input MIDI files into a garageband project. I used to do this very easily, just drag & dropping the file into a blank GB project. That was on my previous older computer, with a previous version of GB. Now I just got a brand new iMac G5 wi

  • I have some problems with my battery of macbook pro 13", the mac doesnt work, what can i do to solve this?

    My mac does not work, i have problems with the battery, what can i do to solve this, can it run without battery?