Skip to Content

First of all, I want to thank SAP team for listening to its customers and making possible the so long-awaited feature of Dynamic Default Values for Universe Prompts.

I’ve just tested it from SAP Business Intelligence 4.1 SP6 and let me tell you, this new feature works like a charm.

Let´s see how it works.

1. Suppose you have a report with the following query and you want it to automatically bring yesterday’s date as first parameter and tomorrow’s date as last parameter:

ScreenShot177.jpg


You could transform the date values in standard prompts but you’ll have to type the dates manually.

Or you could transform them in the new dynamic prompts.

2. To achieve this, open Information Design Tool, open your universe and go to Parameters options.

Create the following parameters: MyStartDate and MyEndDate

ScreenShot174.jpg

2.1 Configure MyStartDate:

ScreenShot175.jpg

As you can see we have a formula like CurrentDate()-1 in Default Values area.  We were able to insert this formula because when you press the button

ScreenShot003.jpg a new Formula Editor window is displayed. This Formula Editor comes with a wide range of predefined functions that certainly will help you save a lot of time creating formulas.

ScreenShot002.jpg

Press Ok. Then, uncheck “Keep Last values” checkbox, because we don’t want the same static value every single time, we want it to change when we refresh our report.

ScreenShot200.jpg

Apply following settings to the other parameter

ScreenShot176.jpg

Create your formula with the formula editor and uncheck this option:

ScreenShot200.jpg

5.Save and publish universe

6.Open your webi report

7. Select Prompt:

ScreenShot178.jpg

Select following option to configure our first prompt:

ScreenShot179.jpg

Select “Parameter from universe” option, then choose “MyStartDate”.

ScreenShot180.jpg

ScreenShot181.jpg

8. Repeat step 7 for the second prompt, just that you have to choose “MyEndDate”.

ScreenShot182.jpg

Then our query will look like this:

ScreenShot172.jpg

10. Execute. You will see that by default Parameter 1 brings yesterday, and Parameter 2 bring tomorrow’s date, without losing the ability of introducing other dates if you want to do that.

ScreenShot184.jpg

11. Save your report.


This is it. Now you are ready to Schedule your report.


With the right formula you will be able to say goodbye to that boring situation when you have to change the dates manually every single month.

To report this post you need to login first.

7 Comments

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

  1. Krishna Reddy

    Hi,

    May I know which version / patch you are using to create this. We are unable to see ‘Formula’ option under ‘Default Values’ to set the default values in IDT.

    Regards

    Krishna

    (0) 
    1. Erika Atencio Post author

      Yep,  SAP Business Intelligence 4.1 SP6.

      If you can´t upgrade to this version then you could use Dave Rathbun’s workaround to generate dynamic prompts

      http://http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/

      There are others workarounds, too, like creating a table in your database which will contain all possible date ranges like yesterday, last month, last year , etc using SQL date operation sto pre-generate those values daily in your db before 8 am having previously added that table in your universe, of course, and use it to get values, but I think Dave’s workaround is the easier one.

      (0) 
  2. Jeroen Van Olmen

    Hi Erika,

    nice post.

    However, I’ve got one question. I use SAP HANA input parameters with an expression. When I create a Universe, these expression (dynamic) input parameters seem to be stored as a Constant Value. How can I use dynamic HANA input parameters in BO with a prompt?

    (0) 
  3. Abdul Mannan Mohammed

    Hi Erika,

    Thanks for the post, very helpful…

    I have very similar requirement except that user wants to see on the Webi Prompt as below:

    Begin Date: [Date selected though calender]:11:00:00 PM

    End Date: [Date Selected]: 10:59:59 AM

    So, i thought of using RelativeDate(CurrentDatetime();0.4583333333333333) the formula

    results are strange

    I thought the system should CurrenDate (which is lets say 5/4/2016 12:00:00 AM) + 11 Hrs/24

    but CurrentDateTime has varied timing so, never produce 11:00:00 PM.

    Any ideas…while I am playing with it.

    Thanks in advance!

    (0) 

Leave a Reply