Secret Custom Format (for Date) in Webi
Update as of 6/15/2016 9:40 AM EST:
I found that there is another secret format, to show Week Number of a Year, define the custom format as (ww). You can also use this format in a variable with FormatDate function as =FormatDate([Date];”ww”), it will return the Week Number of the Year.
Did anyone notice the secret custom format (for Date) available/that works in Webi report?
Apparently, we can easily format the Dates to show Quarters as Q1/Q2/Q3/Q4, I just discovered it for myself. I don’t know how many people knew about it or since which version is this available or is not a secret anymore, I’m using BO 4.1 SP5.
In a sample report, add Date column twice in a table.
Right click on the 2nd column -> select Format Number -> in Format Number window, select Date/Time -> and from Sample select any one (screenshot has Sep 21, 2004 selected) -> click Custom
Update the Custom Format
From (Mmm d’, ‘yyyy) (or whatever else)
To (qq yyyy) as shown below and click Add to close this window and OK on the Format Number window to close it.
Voila, we unlocked the secret custom format. Now the reports looks like below:
Update to this post as of 10/02/2015 8:53 am (EST)
I just realized that this custom format (for Quarters) has been added in Information Design Tool’s feature where we Edit Display Format of an object. Check it out, its great and very helpful.
Update to this post as of 10/14/2015 4:12 pm (EST)
This can be done only in Java Applet mode (and Webi Rich Client) as most of you already know that HTML mode doesn’t let us create Custom Formats.
Update to this post as of 12/27/2016 3:48pm (EST):
Another secret format that works, set the custom format as ww, it shows the week number, it can be used in the formula of a variable as =FormatDate([Date];”ww”)
Great Webi trick !
You've been added to Webi 4.x tricks : summary for a better visibility. Keep posting !
Isn't this only in applet mode? You might want to specify that, since I don't see it in interactive (HTML) mode. You can get to interactive mode by changing your preferences...
Updated the blog post as you suggested.
Nice feature! Very quick and handy. Thanks for sharing.
Thanks for sharing it..!!
Not sure this is new; works in 3.1 SP7; willing to bet this goes back to the introduction of the Timedim function in 3.1SP3, if not before.
Good job raising awareness though, lots of these things remain undocumented until people like you stumble across them 😉
I didn't know it existed already, in 3.1 SP7 (and/or earlier). I've to agree with what you said, "...lots of these things remain undocumented..." 🙂
Another secret format that works, set the custom format as ww, it shows the week number, it can be used in the formula of a variable as =FormatDate([Date];"ww").
Hope someone at SAP would update the "Using Functions, Formulas and Calculations in SAP BusinessObjects Web Intelligence 4.2" documentation on page 39 in section 6.1.1 Custom formats.
Thank you, this is so helpful!
One question - do you maybe know why format set in IDT Edit Display Format is displayed differently in Webi? Format I choose is defined as such in Webi, it is just that it is displayed as full date instead of ISO week that I set up in IDT. Thanks in advance!
Thanks for stopping by at the blog!! You've a valid question, but I think SAP may also have a valid reason to why they have it like that. Simple example, in Webi Formatdate() function can take care of all the different options we see in IDT. Makes sense? Check out this blog for more info on formatdate in Webi.
In the comments, you'll see a comment by Arijit Das, showing displaying time in different formats.
The week function is not perfect, watch out for this bug in Webi 4.1 SP5:
FormatDate(ToDate("1/01/2017";"dd/MM/yyyy"); "ww") = 52
FormatDate(ToDate("1/01/2017";"dd/MM/yyyy"); "yyyy-ww") = 2017-52
The week calculation is also inconsistent with the weeks displayed in MS Office:
Thanks for the info Puneet!!