Skip to Content
Technical Articles
Author's profile photo Ashok Mahalingam

Web Intelligence – Multi-Level Dynamic Break/Sort using Prompt

In this blog you will learn how to design and configure dynamic breaks and sort in web intelligence. This is a typical challenge that we face in most of the web-intelligence reporting tool as this is not something that the tool can offer directly. This would help a developer / power user trained in web intelligence / IDT (Information Design Tool) to create an effective web-intelligence reporting as breaks and sorts play a vital role in any reporting.

Problem Statement: Consider a scenario where you want to build a web-intelligence report with a requirement to break or sort dynamically and should also be able to prompt the user to select object to break/sort at user prompt. For Example, I want to build a web intelligence report which I should be able to select 2 objects ie., Service Area & Billing Provider for the report break or Sort at the prompt (leverage to use the option for scheduling as well). How do I go about accomplish this?

Following steps would exactly explain how to do this.

Note:This can be easily extended to any number of objects based on individual reporting needs.

SolutionThis is a multi-step process that I layout below step by step in both Information Design Tool (IDT) as well as in web-intelligence tool.

IDT Steps: Open IDT Tool and create below static LOV/Parameters/Variables & Filters using below steps.

  1. Create a static LOV named “Grouping by” at Business Layer (see below). This where you list out all the names of objects user is familiar with for dynamic break/sort or even can be used for scheduling.

2) Create parameters. In this example, I am going to create 2 parameters Group1 & Group2 as I am going to give 2 levels of break/sort. See below screen shot

Give appropriate Prompt text how you want the prompt to display. Here I am using the Prompt texts as “i. First item to group by:” for Group1 and “ii. Second item to group by:” for Group2 parameter.

3) Create Filter: Create a “Group” filter

The SQL expression for the above Group filter is as below:

@Prompt(Group1) IN (‘None’,’Service Area’,’Billing Provider’)

AND @Prompt(Group2) IN (‘None’,’Service Area’,’Billing Provider’)

Note: If you want to give more than 2 levels of breaks, you need to add that many number parameters and add that many number of ‘AND’ conditions here.

Caution: You won’t be able to parse Group filter as there is NO table associated to it

Once the universe is published to the repository, follow below Web Intelligence steps.

 

Web Intelligence Steps:

  1. Open web intelligence tool, using the universe published to the repository, fetch the necessary objects needed for reporting along with a Break filter i.e. “Group” in this example dragged into “Query Filters” (see below)

2) Make sure to add the objects which are going to be mapped to those 2 breaks. See below screen shot.

3) Click “Run Query”. See below screen on what to expect.

4) Select ‘Service Area’ in Group1 prompt and select ‘Billing Provider’ in Group2 prompt (see below)

5) Execute the report and create following 2 variables at report level for each Break. In this example, we need to create 2 sets of variables as we are doing 2 levels of break.

6) Add the above variables to the report. See below.

7) Go to Manage Breaks and add those 2 variables created at reporting layer ie., Group1 and Group2

8) Report should look like below once after the unnecessary break header is cleaned up.

Note: If you are interested in Sorting only, open “Manage Sorts” and add Group1 and Group2 variables you created at report level. (see below)

Conclusion:  

You can use this solution towards any web intelligence reporting which would require dynamic breaks/sorts and to any number of levels. This just a template and it can be extended to any relational database and for any number of breaks and sorting scenarios.

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sivam s
      Sivam s

      Try this

      1. Identify the Max Number of columns that need dynamic sort
      2. Create those many dummy objects as below. In the below example we considered 3 as the Max Number of columns that need dynamic sort.

      REGEXP_SUBSTR(@prompt(‘SortOrder’,’A',,Mono, free,,),'[^,]+’, 1, 1) as SORT1 REGEXP_SUBSTR(@prompt(‘SortOrder’,’A’,,Mono, free,,),'[^,]+’, 1, 2) as SORT2  REGEXP_SUBSTR(@prompt(‘SortOrder’,’A’,,Mono, free,,),'[^,]+’, 1, 3) as SORT3

      1. Add 4 blank columns at the beginning of the block. And add the below formulas for checking  each dummy object against all 4 fields to identify which one to consider as 1st, 2nd and 3rd.

      =If([SORT1]=”City”) Then [CITY] Else If([SORT1]=”State”) Then [STATE] Else If ([SORT1]=”County”) Then [COUNTY] 

      =If([SORT2]=”City”) Then [CITY] Else If([SORT2]=”State”) Then [STATE] Else If ([SORT2]=”County”) Then [COUNTY] 

      =If([SORT3]=”City”) Then [CITY] Else If([SORT3]=”State”) Then [STATE] Else If ([SORT3]=”County”) Then [COUNTY] 

      1. Apply sort on all 4 columns and hide them.
      Author's profile photo Samatha Vasireddy
      Samatha Vasireddy

      @ Ashok Mahalingam

      I am trying to implement this for grouping based on prompt values. Suppose if the prompt has two values and have to implement grouping on those two values on the layout and user can choose randomly multiple values for one prompt.

      Grouping cannot be done based on user prompt because it is considering those two values into single text.

      Please suggest.