emergingbytes.com Technology blog for data warehousing, business intelligence, iPhone Apps Development, Android Apps development and facebook applications

10May/130

Creating Reusable Dashboards in Dashboard Design 4

There are two approaches of developing dashboards using Xcelsius or Dashboard Design (Version 4 and on-wards). These approaches are listed as follows:

  • Build all your components in one Xcelsius file. Linking and drilling is done within the same scope of single xcelsius or dashboard design file
  • Build all your components in one or more Xcelsius file. Linking can be done across XLF files and so is drilling. Use of openanalytics command maybe required or use of Load SWF component.
  • Design your components with inputs and outpus in xcelsius and export them to BO platform. Use Dashboard Builder to paint the layout and do the linking using content linking available in dashboard builder

It is essential to make this design decision on development approach before development phase is started. Some of the factors to consider are:

  • How many different layouts/views required by the client. Different views maybe required to faciliate various stakeholders across various departments. In this case creating a super set of xcelsius graph components and then building views using dashboard builder is a smarter way forward
  • Whether customer requires a lot of filter parameters on components.
  • Understand requirement on drilling. Does it require changing of complete layout. For instance, initially a dashboard may have two graphs. One with region and the other one on day. When drilled, customer may require both the graphs to change based on selected region and day.

These are only few considerations and you are the better judge on the approach as you have to meet the timelines and also to keep dashboards scale-able. Every dashboard requires re-finishing/final touch-ups due to the reason when it goes to customers they always have some feedback. Therefore, your design should be able to accommodate such ad-hoc requests which results in either changing the layout or changing the characteristics of graph linking, filters and drilling.

1Apr/121

Teradata Query Banding In SAP Business Objects Information Design Tool

Usually customers require tracking and auditing of users and queries they are running on DWH/Teradata. There is no one way of tracking queries run by BI application users. An application user is not necessarily a Teradata user, therefore,  query band is a useful feature for tracking logons and queries generated from BO and BO users. Queries are logged in DBQL along with necessary information. For instance:

  • Application (Business Objects) username
  • Universe name
  • Document name
  • etc (further details can be found in SAP BO documentation)

This is achieved using query banding feature provided in Teradata and is exploited in SAP Business Objects using 'BEGIN_SQL' parameter for SQL Generation. An example of BEIGN_SQL string is as follows:

SET QUERY_BAND='USER='@Variable('BOUSER');Document='@Variable('DPNAME')';' for transaction;

As per SAP documentation, it should work fine and it does work fine if you are using it in Universe Design Tool. But when used in Information Design Tool, it returns an error due to problem with SQL generation. Issue is due to @Variable function which returns a value enclosed in single quotes. For some reason, this is taken care of in Universe Design Tool but since Information Design Tool is new, it causes SQL error on Teradata.

Until SAP development team fixes this issue, a workaround can be used for query banding in Information Design Tool and that is to call a Teradata Stored Procedure in BEGIN_SQL and pass necessary parameters to it as inputs. Query band can then be set within the procedure.

For further details or queries, leave comments and we will reply.

1Jun/111

Distinct Measures in Web Intelligence Report

Business intelligence teams across the world have been facing this problem of delivering reports with distinct measures since ages. Many solutions have been proposed and implemented but with increasing hunger of additional dimensions and thirst for quicker results, nothing can fully meet demands of evolving business users. Nevertheless, companies and BI developers are continuously making technological advancements to meet reporting requirements for DISTINCT based analysis. One such effort is done by SAP Business Objects by introducing a feature called "Database Delegate" in their BO XI R3.x version. This post focusing on describing and providing examples of using this feature:

Business Objects Database Delegate:

When designing a universe, many dimensions and measures are created. Measures are the calculated items that are analysed against different combinations of dimensions. When changing the set of dimensions for analysis in report (webi or deski), measure can be projected either using sum, avg, min max  or count. These projections are defined while designing universe under measure properties (by double clicking a measure) and are re-calculated only on report level. Summarization process does not go beyond webi server and all the recalculations take place on webi server or locally if working in offline mode on rich client.

For distinct measures, non of the above mentioned summarization/projection function is appropriate  i.e. sum, count, avg, min and max. By keeping a distinct count in an aggregate table and then counting them or summing them on report level will present incorrect values. For that matter a better approach would be:

  • Keep a granular dimension in the aggregate. For example, you want to calculate distinct number of sessions in a day against different combination of dimensions. To achieve this, the aggregate design should hold a set of analytical dimensions, measures and a session key. This session key then can be used to create smart measures (explained later in the post) for calculating distinct measure correctly in webi reports
  • While designing universe, use a new projection called Database Delegate, that is available in BO XI R 3.x , on distinct measures. For example, to calculate distinct number of sessions in webi, create a measure called 'Distinct Number of Sessions'.  In the properties of this measure, set the projection function to 'Database Delegate'
  • In webi, what will happen is that, when you change combination of  dimensions against which distinct is calculated, '#TOREFRESH' is displayed in Distinct column. This is webi telling report user to hit the refresh button again to recalculate distinct by delegating query to database that will recalculate distinct.
  • Once a user has refreshed a report for different combinations of dimensions, user do not need to refresh webi report to analyse any of already refreshed combinations of dimensions  for distinct measure.

Before using this projection function for your production reports, I would recommend to go through BO Designer guide for better understanding of limitations and precautions. Some considerations are as follows:

  • Number of report users who will be using reports with 'Database Delegate' projections
  • Data Warehouse or data mart processing capacity and average time taken to refresh a webi report containing 'Database Delegate'
  • Frequency of webi report usage
  • Permission sets assigned to webi report users. (In some cases, business users do not have refresh rights

Example:

Step 1: Create a simple aggregate table:

CREATE TABLE DP_MDB.AGG_DATA_TRAFFIC
(
	  DT DATE
	, SERVICE_TYP VARCHAR(10)
	, PRICE_PLAN VARCHAR(10)
	, SESSION_ID VARCHAR(20)
	, DATA_TRANSFER_BYTES INTEGER
)
PRIMARY INDEX(DT, SERVICE_TYP, PRICE_PLAN, SESSION_ID)
PARTITION BY RANGE_N(DT  BETWEEN DATE '2011-01-01' AND
DATE '2011-12-31' EACH INTERVAL '1' DAY );

Populate this newly created table with sample values:

INSERT INTO  DP_MDB.AGG_DATA_TRAFFIC
VALUES (CURRENT_DATE ,'GPRS', 'Prepaid','session00001',RANDOM(0,5000) );
INSERT INTO  DP_MDB.AGG_DATA_TRAFFIC
VALUES (CURRENT_DATE ,'VAS', 'Prepaid','session00001',RANDOM(0,5000) );
INSERT INTO  DP_MDB.AGG_DATA_TRAFFIC
VALUES (CURRENT_DATE ,'WAP', 'Prepaid','session00001',RANDOM(0,5000) );

INSERT INTO  DP_MDB.AGG_DATA_TRAFFIC
VALUES (CURRENT_DATE ,'MMS', 'Postpaid','session00002',RANDOM(0,5000) );
INSERT INTO  DP_MDB.AGG_DATA_TRAFFIC
VALUES (CURRENT_DATE ,'CONTENT', 'Postpaid','session00002',RANDOM(0,5000) );
INSERT INTO  DP_MDB.AGG_DATA_TRAFFIC
VALUES (CURRENT_DATE ,'SONGS', 'Postpaid','session00002',RANDOM(0,5000) );

INSERT INTO  DP_MDB.AGG_DATA_TRAFFIC
VALUES (CURRENT_DATE ,'GPRS', 'Postpaid','session00003',RANDOM(0,5000) );
INSERT INTO  DP_MDB.AGG_DATA_TRAFFIC
VALUES (CURRENT_DATE ,'CONTENT', 'Prepaid','session00003',RANDOM(0,5000) );
INSERT INTO  DP_MDB.AGG_DATA_TRAFFIC
VALUES (CURRENT_DATE ,'RINGTONE', 'Postpaid','session00004',RANDOM(0,5000) );

Step 2: Create a universe for this aggregate in business objects designer and create following objects:

  • Date
  • Service Type
  • Price Plan
  • Distinct Sessions
  • Data Transfer Bytes

Go to the properties of 'Distinct Sessions' and select 'Database Delegated'. This option is available under 'Choose how this measure will be projected when aggregated'. For further details, see the below screenshot:

Database Delegate

 

Step 3: Save and export after validating universe.

Step 4: Create a Webi report using the newly created universe using following objects:

  • Date
  • Service Type
  • Price Plan
  • Distinct Sessions
  • Data Transfer Bytes

and run the report.

Web Intelligence Query

Run Web Intellgence Query

Run Web Intellgence Query

Webi Report Refreshed

Webi Report Refreshed

Values of all measures are visible including distinct sessions.

Step 5: Try removing dimensions to see how it effects calculation of measures i.e. Distinct Session and Data Transfer Bytes

Removing Service Type dimension results in following:

  • Data Transfer Bytes are summed against new combination of dimensions
  • Whereas, Distinct Sessions are not summed up or averaged out. Instead, webi is displaying #TOREFRESH message and suggesting report user to refresh the report in order to get recalculated values from database against the new set of dimensions
Webi #TOREFRESH

Webi #TOREFRESH

 

Conclusion:

This new feature can be very useful if used properly and with right approach. It is a step forward towards solving inconsistent and incorrect calculation of distinct measures by business/end users. It is hoped that more such features will be introduced in coming version and bugs will be removed. Currently there are few bugs in this feature when using with specific databases like Teradata. These bugs will be discussed in future along with possible work arounds until SAP formally releases a fix pack to answer known bugs.