Your quarterly dose of business intelligence tips & tricks - Issue 2 - Q3, 2006
   

Business Objects tips & tricks:

Applying filters on measures - Mission Impossible?

Iimporting .txt files - what happened to my data type?

Effective BO Universe Deployment

 

More tips & tricks:

Siebel Analytics

Oracle

ClearPeaks


Contact ClearPeaks:

ClearPeaks (headquarters)
Valencia 266 3, 1
08007 Barcelona, Spain
Tel +34 93 272 1546

ClearPeaks Tarragona
Plaza Peixateries Velles 3, 2
43003 Tarragona, Spain
Tel +34 97 725 0778

Editor
Anoek Aukema

Contributors
Alex Caminals
Victor Castellá
Victor Cutilla
Emma Gorgori
Moïse Kameni
Jordi Ricart
Albert Seco

 

Applying filters on measures - Mission Impossible?
Author: Jordi Ricart

Introduction
Occasionally when developing BusinessObjects reports, it is required to filter the results based on a measure. If this measure contains a complex formula or if there are different levels in the same hierarchy, it might seem like a 'Mission Impossible'. Nevertheless, this article will demonstrate how this can be done.

In the following example, we will try to create two different reports (‘Months with Revenue over 50000’ and ‘Quarters with Revenue over 100.000’) with one single query. We will need a little trick in order to achieve our goal as BusinessObjects will not allow us to do this as easily as it may seem.

Let’s build a simple query on the ‘Islands Resorts Marketing’ demo Universe. Let’s take the following objects:
• Resort Class : Country and Resort
• Sales Class : Year, Quarter and Month
• Facts : Revenue



By checking the ‘Data Manager’ we can see that the values on the ‘Revenue’ Column are the totals for by 'Resort and Month'.

Filter 1: Months with Revenue over 50000

So far, no big issues, we get back to our table, and we apply an advanced filter on the Revenue object with the following formula: =<Revenue>>=50000

1. Select the Revenue Column

2. Format Menu

3. Click on ‘Filters…’



4. Select the Table we want to add the filter to

5. Select the appropriate measure (i.e. Revenue)



6. Click on ‘Define…’ to add an advanced filter

7. Enter the formula manually or with the formula wizard (=<Revenue>>=50000)

8. Click OK on the formula wizard and OK again the filter screen



Done. We get the list of months with revenue greater than 50.000. As we can see in the next image, only the Hawaiian Resort has months with more than 50.000.

Filter 2: Quarters with Revenue over 100.000

The first approach to get the results for the Resorts that have achieved more than 100.000 in a quarter, and as wee don’t want to create a new query, would be to duplicate the current report, delete the column ‘Month’ and change our filter to be ‘100.000’:

1. Remove the column ‘Month’

2. Edit the table filters

3. Change the value to 100.000

4. Click OK to save the new filter



The result we get: A nice empty table! Is this correct?

When adding a new report, without filter, with the dimensions above (Country, Resort, Year, Quarter and Revenue) and then sorting it in descending order by Revenue, you will see the following will appear:



So what is the reason for having an empty result with our filter of 100.000?

BusinessObjects is applying the filter to the values of the measure that are in the DataManager in our example at the lowest level available (Month and Resort).
There is no way on filtering a table based on an aggregation. Well, in fact, there is no ‘easy way’, but let’s figure out a workaround to this issue:

In our last report, (image above), we just need to hide the bottom lines, the ones with revenue under 100.000.

1. Add a new column

2. Add the formula =If <Revenue>>=100000 Then 1 Else 0

3. Save this formula as a variable

4. Name it ‘Revenue bigger 100k’

5. Click OK to save the changes



Now, as we just want to have the ‘1’ rows, let’s apply a ranking to …. what ? Where should I apply the ranking? Resort? Quarter?

Give it a try, none of them work! Applying a ranking to only one dimension will not bring back the right results.

Our minimum unit is ‘Revenue by Resort and Quarter’. As the Quarter is linked to a Year, we will define a new variable with the combination of our three dimensions into one:

1. Add a new column

2. Add the formula: =<Year>&"/"&<Quarter>&"/"&<Resort>

3. Define this formula as a new variable

4. Name it : Resort & Quarter Dimension



Now, we have a ‘complex dimension’ where to apply our ranking in order to only get the rows where our condition (Revenue > 100.000) is true, and the value of our measure is ‘1’ :

1. Select the ‘Resort & Quarter Dimension’ Column

2. Apply a Filter clicking on the icon or through the ‘Format->Ranking’ Menu

3. Select the ‘Top’ Ranking option, and change to get only the top

4. Change the measure to be based on our ‘Revenue bigger 100k’.

5. Save all changes by clicking on OK



We get the result we wanted as we can see below:


Finally, let’s hide our ‘workaround’ columns:

1. Format your table by clicking on the icon, or through the ‘Format->Table’ Menu

2. Select the ‘Resort & Quarter Dimension’

3. Click on Hide to not display this column in the table layout

4. Select our ‘Revenue bigger 100k’ measure

5. Hide it with the same procedure

6. Accept all changes clicking on OK

Be creative and re-use the idea of ‘ranking’ the top ‘1’ for your flag variable (if XYZ happens then 1 else 0). You can create quite complex filters in that way. Give it a try yourself - it is a Mission Possible!

Go to top


Importing .txt files - what happened to my data type?
Author: Victor Cutilla

Most BusinessObjects users who have imported .txt data providers before, have encountered the issue of unexpected data types. For instance, if in a txt file you have a field (i.e. the price of an article) which of course after importing you expect to be numeric. However, after importing the .txt file you realize that the specific field displays as a character data type.




The reason for this behaviour is that most likely the first rows of the .txt file for that specific field are empty. On import Business Objects reads these as text and as a result interprets the entire column as character data type.



You may think that in order to get this resolved you just need to make sure you have values in the first row and then you import it again. However if you do this you will see that the column keeps being interpreted as a character data type.
Well then, how can this be fixed?

It is very simple - follow these steps:

1. Open the .txt with excel (File - Open, or right mouse click in Explorer and 'Open with Excel')

2. Remove the specific column in the .txt file - of course keep a backup of the original file.



3. Import the .txt file again and make sure that the field is not in the data provider

4. Now open again the .txt file with Excel and sort it by the 'Article' column, so you make sure that you get this field filled (with numeric values of course) in the first rows




5. Import again the .txt file

6. And, voila, you will see that the object in the Data provider is now of type numeric





Go to top


Effective BO Universe Deployment
Author: Albert Seco

Scope of this trick

This is a trick to use one unique BusinessObjects (BO) universe file hitting different database environments with different database names. When having these different database names, the problem is that different universe files should be needed as the parameters for that universes would be different between the environments.
By doing this trick, the advantage is that there is no need to maintain two or more different BO universes and therefore reduce time, effort and cost.

Background
The implementation is as follows:

There are two SQL Servers each containing one database. The databases are the same in terms of structure, although from a data perspective, one contains development data (“DEVdatabase”) and the other one contains production data (“PRDdatabase”).



Another difference is that they have different database names, with the constraint being that the name of the database cannot be changed.
Typically in this situation the end-user would have to work with 2 separate BO universes for each database, as the Qualifier prefix for the Structure tables will be different between the universes. In addition, any changes made by the universe developer would need to be done twice.



Solution
In a situation like this, the solution that we propose is the following:
The first step is to create a database in both SQL Servers (development and production environments) with the same name (i.e. “BOdatabase”).




Secondly, and this is the solution we are proposing, the universe designer has to create as many views as tables exist in the original database. Each view points directly to each table in the source database. This means that the universe designer will have a database made up of views instead of a database made up of tables, for each of the environments.




At this point in BO Designer, it is required to point all required tables to this new database (not taking into account which database server is pointed when importing the tables, as the name of the database will be the same in both servers).


As the name of the Qualifier in the universe is the same for both databases, the universe designer has the ability to point to both SQL Server databases as needed.
In order to do that, the user has to create different BO connections to each SQL Server pointing to the new database (made up of views, instead of tables).



Once this setup is completed, the same universe file can now be used for both environments. The end-users just need to log into BO and select which universe they want to access (development or production one) and the universe designer just needs to modify one universe file. This process will save both the end-users and the universe designer valuable time and effort and makes the environment cleaner than before doing this change.

 

Go to top