Some of you might have seen my first blog on our time based filter. In case you missed it, here is the link : Part 1.

Today I would like to explain this very helpful component in a little bit more details. We all know that SAP BusinessObjects Design Studio does provide the ability to use JavaScript code as part of your dashboard, but I would hope that people agree that we also should try to make it easier for the person creating the dashboard when we can… and that is where the Period Selector comes in.

Lets assume you would like to provide your users the option to simply select a month, or a quarter, or multiple months and filter the data source based on the selected value. In most cases the underlying data source will store the time information in form of a real date (makes it easy) or in some other way, for example  201504 for April 2015.

So in my example I am using our Monthly Period Selector:

BLOG_PERIOD_SELECTOR_001.jpg

and I navigate to the Additional properties of the Period Selector:

BLOG_PERIOD_SELECTOR_003.jpg

Here you can see that I have the option to specify a Date Format and enter a Custom format. In my example I entered “yyyymm” as the custom format because in data source – which is SAP BW – the Calendar Month is stored like this : 201504 for April 2015.

Now all I need to do is to go to the onSelect script item for my Period Selector and enter the following script:


DS_1.setFilter(“0CALMONTH”, PERIODSELECTORYM_1.DSXGetSelectedValueInDateFormat());

DS_1 is my data source and 0CALMONTH is the dimension for my Calendar Month.

My Period Selector component has a function called DSXGetSelectedValueinDateFormat, which will return the date value exactly in the format that I specified, without me having to do any coding and trying to take a datefield apart and putting it back together as needed.

So this is already a great help, but what if April 2015 (201504) is not actually 04 2015 – but instead 01 2015 because my Fiscal Year is starting in April 2015 ?

In that scenario, all I would need to do is to configure the new Fiscal Year option (Part of our upcoming release 2, scheduled for May 2015).

BLOG_PERIOD_SELECTOR_005.jpg

When configuring the Fiscal Year option I can choose the starting Year (in our example 2015) and the Fiscal Year Label (also 2015 in our example) and the first month of the Fiscal Year – in our example April.

The reason for a Starting Year and a Fiscal Year Label ? Think about the following scenario: In October 2014 your Fiscal Year 2015 starts, so your starting year would be 2014, but your label is 2015.

After I configured this, my calendar control changes:

BLOG_PERIOD_SELECTOR_004.jpg

and the month April is now the first month to be displayed.

In addition the function DSXGetSelectedValueinDateFormat would not return 201504 for April 2015 anymore, but instead it would return 201501 because April is the first month of the fiscal year 2015.

…. and all this without having to write extra code.

In case you are interested to see more of those components, feel free to download our trial : www.visualbi.com/DSXTrial.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply