Wednesday, May 17, 2017

HOW TO DISPAY SECONDS IN HH:MI:SS FORMAT IN OBIEE


We can use OBIEE custom format to display  seconds to dd Days hh:mi:ss instead of writing complex logic.

Use the following custom format string  [duration(sec)] dd "Days" hh:mm:ss

1. Go to OBIEE column Properites --> Data Format
2. Select Override Default Data Format Option
3. Set Treat Number as to Custom and set the format to [duration(sec)] dd "Days" hh:mm:ss

Note: String literals should be enclosed in " " .
          For Ex: in our case we have enclosed Days string in " ".


Similarly we can convert Days or Hours or Minutes into required format by using the below custom Format literals.

[duration(hour)] dd "Days" hh:mm:ss
[duration(min)] dd "Days" hh:mm:ss
[duration(day)] dd "Days" hh:mm:ss

1 comment:

Ramesh Choudhary said...

Thanks Dinesh. Very useful information on duration custom format.

Just one correction, For Hours correct format is [duration(hour)] dd "Days" hh:mm:ss as it is case sensitive, otherwise by default it will treat as seconds only.

Here one more addition dd "Days" is optional.

Once again thanks.