In this blog I will show you how we can add parameters in data model.

Pre-requisities:

Before you start you should have

  1. Access to Oracle Cloud Environment
  2. BI Developer Role

Please read the previous blog on the basics of developing a BI Report in Oracle Cloud. You can read it here.

Add a Parameter

The first thing that we need to do is to navigate to the Data Model Editor. Select the data set and then click on the edit option (Pencil icon). Check the below image for more details.

Edit Data Set

Once you click on edit, the Edit Data Set window will be shown where you can edit the SQL. In our example, lets add a condition to display the GL Periods based on a given year. We will add the below condition in the SQL:

WHERE period_year = :p_period_year

 :p_period_year is the bind variable.

Change SQL Query

Click OK and you will be prompted with the below dialogue box.

select bind variable

Select the bind variable so that the system creates a corresponding variable. Click OK. The system creates a variable named p_period_year and navigates to the Parameters page. Lets change the display label at the bottom of the parameters page to “Period Year”.

Parameters Window

In the Parameters page, you will be able to:

  1. Select Data Type
  2. Set Default Value
  3. Select Parameter Type
  4. Select the row placement
  5. Display Label
  6. Set the Text Field Size

Save your changes and then click on Data Sets and then on the Data Tab. Now you should be able to see the Parameter that was defined. Enter a value of 2016 and click on “View”. The output shows periods belonging to 2016 period year.

Data Output

Click on “Save as Sample Data”. We will work on the creating a list of values in the next blog.

You can add multiple parameters to your query. Once you add the bind variables, the system will prompt you to automatically create corresponding parameters.

If you have questions please feel free to ask in the comments section or you can connect with me on twitter.

Leave a Reply

Your email address will not be published. Required fields are marked *