Professional Documents
Culture Documents
Transformer
What is Transformer?
In this workshop, we will take a look at a Transformer model and discover a few
common problems. We will discuss how to fix these problems and how to
improve the overall design of the cube.
The main difference between the Series 7 and Cognos8 versions of Transformer
lie in a setting in the trnsfrmr.ini. The entry ‘EnablePCOptimizer’ is enabled by
default in the Cognos8 version. PowerCubes created in the Series7 version of
Transformer are usuable in Cognos8, though it is recommended to use the
‘pcoptimizer.exe’ to optimize the PowerCube for access by Cognos8. After a
PowerCube has been updated with this utility it can still be used with Series 7
applications.
Getting Started
• Once the application is finished resetting, Transformer will launch and you
may begin the workshop
You have just taken over a project for a co-worker who has left for a six-month
trek in the Andes. The first task that you’re responsible for is to complete the
main cube that they have been working on. Unfortunately, the individual who
was responsible for this task before you, never got around to documenting the
project, and you must now find out what is left to be finished. It is now up to you
to fix the model and improve performance.
1. In Transformer, click the Open button on the toolbar, and open the
model named c:\techforum\transformer\GO_Tech_Forum.mdl
The first thing that should be done with a new model is to check to see if there
are any errors or warnings
2. To check the model, click the Check Model button on the toolbar
2
You can see that there are quite a few errors and warnings in this model; it sure
is a good thing that you are on the job! Let’s examine the first error on the list.
What could have happened here is that changes were made to the data source
but Transformer wasn’t updated. The columns that Transformer is currently
referring to may no longer exist. Make a note that the data source in question is
GO Retailers
3
Notice on the Model: side of the dialog that the Display Name of
RetailerContactCode has a plus sign + under the Mismatch (M...) column:
This means that the column that Transformer is using in the model cannot be
found in the data source. Can you see why it can’t match the two together? If
you look closely, you will see that the data source is referring to
RETAILERCONTACT_CODE where as the Model is referring to
RETAILER_CONTACT_CODE (with a n additional underscore)
2. To correct this problem, on the left side pane (Source), select the
RETAILERCONTACT_CODE from the Name: column, and from the right
side (Model:) select the original name RETAILER_CONTACT_CODE
from the Original Name column, and click the Match button so that
Transformer can re-establish the link
3. Click OK to close the Column Matching dialogue box, and the Modify
Columns window
Our data sources now match up. To investigate the next problem, click the
Check Model button again
4
The warning that we’re concerned with now is:
This message can be a little overwhelming but it really isn’t too bad. The best
way to appreciate what’s happening is to introduce “scope”. Scope simply
identifies what dimensions a data source or measure provides information for:
2. Right-click the first data source in the Data Sources window which is GO
Product Line, and select Show Scope
Notice that a new Dimension Map window appears with the Products dimension
highlighted in yellow. Yellow indicates that a data source or measure provides
information for a particular dimension - basically, yellow is good.
If you scrolled through the dimensions in order from top to bottom, you should
now be looking at the scope for the GO Orders data source. You’ll notice that all
Dimensions are yellow except for Sales Staff. Since this is the data source upon
which all Measures are based (i.e. it has all the transactional data), it is important
to have all Dimensions yellow. This implies that the data will be valid for all
dimensions. Otherwise, as the warning suggests, we will not have any valid data
for the categories in the Sales Staff Dimension
Another way to examine scope would have been By Measure. Try this and you
will see that one of the dimensions is displayed in green:
2. Expand the drop-down list with your mouse and select Actual Revenue
3. Scroll through the list by using the down-arrow ↓ and notice that the Sales
Staff dimension is green for all measures
This means that there is no direct tie to the measures and they will be allocated
across the Sales Staff dimension. Transformer uses allocation to associate data
to levels and dimensions where it does not necessarily have a relationship via
the current dataset. This is not what we want so we will have to correct the
model.
5
In order to provide scope to Sales Staff, we must ensure that the lowest level in
the Sales Staff Dimension exists in the Transactional data source. This is
particularly true since the Sales Staff dimension is based on only one data
source and the Sales Staff level is designated as unique. Let’s examine the
Source of the Sales Staff level:
1. Close the Dimension Map pane previously opened to inspect the scope
by clicking the X in top-right corner
2. Click on the Data Sources pane and Expand the GO Sales Staff and the
GO Orders Data Sources. Take a look at them and see what columns
you have available to you
3. In the Dimension Map, double-click the lowest level in the Sales Staff
dimension which is called Sales Staff
6
4. On the Source tab, you can see that both the Label and the Source are
using the same field from the data source. In this case it is
SalesStaffName
• In the Data Sources window, notice that the data source GO Orders
has no SalesStaffName field available. This is the source of the
problem since Transformer cannot relate the transactional data to the
Sales Staff dimension. Note that we do have a SalesStaffCode field
(2) Change the Source of the Sales Staff level to use the existing GO
Orders field called SalesStaffCode
7
Since we know that the GO Sales Staff data source will be able to match each
SalesStaffName to the respective SalesStaffCode, it is easier to simply change
the Source of the level instead of the GO Orders data source.
6. In the Dimension Map window, double -click on the Sales Staff level and
then under Source, click on SalesStaffName
10. Click OK again to get you back to the Level – Sales Staff window
• You are now using the SalesStaffCode as the Source and you are
using SalesStaffName as the Label
11. Click OK and then click the Check Model button again
8
• You should now see one final Warning and no Error messages
Warning: (TR2751) This model contains one or more cubes with cube
optimizations other than Auto-partition. Better performance may be
realized if the optimization setting for these cubes is changed to Auto -
Partition.
It is being highlighted that the cube does not have auto-partitioning enabled. To
enable Auto-partitioning, do the following:
Retrieving information from a cube is similar to retrieving files from a hard drive.
If a drive is broken down into multiple partitions, it’s easier to find a file, and the
same works with PowerCubes. The key thing when breaking a cube down into
multiple partitions is determining the estimated number of consolidated records.
The best place to get this number is from the Transformer log file. In this model,
we only have a small set of data.
• When we build the cube later on, we’ll be able to see the different
partitions
9
This resolves the last of our major errors and warnings, but let’s check the model
again.
Now that all of the errors have been resolved, let’s make sure that we can build
the cube:
We can see that our cube spans 6 partitions: 0 – 5. This will definitely help with
performance in larger cubes but we probably won’t notice anything in this cube
since it is fairly small
5. Click Close
10
Time Based Partitioned Cubes (TBPC)
The advantage to using TBPC’s is that a cube can be accessed on its own or
part of a group through the parent cube. Also, updates should be quicker since
only the last cube should have to be updated.
New to Transformer 7.3 is the ability to perform category counts on the time-
based partition cubes. Let’s begin by setting up the measure to do this.
1. Right click in the Measures window and then select Insert Measure …
3. Click on the Type tab and then check the Category Count radio button.
4. Select Sales Staff for both the Dimension and the Level.
5. Click OK
11
Define the Time-Based partition cubes:
• Notice that as soon as you click the checkbox, you are forced to use
the Date dimension
6. Click OK
• You can see that Transformer created the parent cube named
TBPC.mdc along with a folder called TBPC containing the child cubes
9. From the File menu, select Close to close Windows Explorer, and you
should now be back to Transformer
10. Right-click on the TBPC cube in the PowerCubes window, and select
View PowerCube
Now that you are in PowerPlay, you cannot tell that you are viewing a time based
partitioned cube. Also, there will be no performance degradation when viewing
these cubes.
• From the File menu click Exit for both PowerPlay and in
Transformer
• If prompted, do not save changes
12