Specifying the data to use
Before designing the report it is necessary to specify what data you will be working on and which the connection mechanism will be.
This tutorial builds a report using data stored in an O3 cube.
Extraction of these data is performed in 2 steps:
- Define the data source
- Define the data set.
You may have several data sets defined on the same data source.
Defining a Data Source
- Select New Data Source in the Data menu to create a new data source.
- Choose the Data Source type for O3 (O3 Data Source)
This lets you define a data source for O3 cubes and views. These O3 data sources may be of two types:- Sources that access views saved in the server.
- Sources that access cubes saved in the server and use MDX language to specify the query.
- Indicate the Data Source Name.
In this example the data source will be called "O3 Local" - Enter the Data source parameters.
Host Name:
The name or IP address of the server where O3 is running.
In our case:localhostPort:
Server port indicated in the parameter above where O3 server is run.
In our case we will use port 7777 by default.User Name:
Name of the user defined in O3 that will be used for connection to the server.
In our case, we will use userPassword:
Password of the user defined in the previous field.
In our case we will use the user's password.Query Type:
It indicates the Data Source Type to be used: MDX Query or O3 View.
In our case O3 View - Check the connection was properly by pressing the Test Connection button
Defining a Data set
Once the Data Source has been defined, you may define the Data Sets to be obtained from such source. Each Data Set will be a different query which, as mentioned before, may be generated from a view or through MDX
Whatever the case, the creation of the Data Set is the same.
For the specific case in this tutorial a view on the wines cube is used, as seen in the image below.
In this view, measures Litres Sold (Litros Vendidos) and Net Sales (Venta Neta) are selected as columns, and dimensions Salespeople (Vendedores) and Wines(Vinos) in their corresponding levels Salesperson and Wine, are placed on the vertical axis.
Once the view has been defined and saved in the server under the name VinosPorVendedor, as a public view, the following steps must be followed:
- Select Data Set from the Data menu.
- Indicate the Data Set Name
- Select the Data Source in which the Data Set needs to be defined.
In this example, the data source is called "O3 Local". - Select O3 Data Set as Data Set Type
- In the new Data Set definition window, enter the query shown below to obtain the data displayed in the public view VinosPorVendedor. This view must have been created beforehand in the O3 Server.
In the query, it is important to point out the clause FROM in the clause referring to 'Vinos/VinosPorVendedor#_public'. This is the name by which we refer to the necessary view for this report.Vinos
This is the name of the cube just as it is published in the server.
VinosPorVendedor
The name of the view where data are extracted from.
#_public
It indicates the view is a public one.
- These data can be extracted from the web browser status bar, after sourceVinos/VinosPorVendedor#_public in the markers' page.
- Press Finish to accept changes.
- The window shown below lets you modify additional parameters of the Data Set, as well as obtain a print preview of the query.
Defining Data Sets through MDX
The steps above have enabled us to create a Data Set using a view previously saved in the server.
O3 allows for an alternative method which does not involve saving any view, but on the contrary allows the designer of the report to indicate the query directly in the report itself.
- Create a new Data Source called llamada O3 Local MDX with the parameters below.
Host Name:
localhost
Port:
7777
User Name:
user
Password:
user
Query Type:
MDX Query
- Create a new Data Set called MDX Sales with the same parameters.
Name:
Ventas MDX
Data Source:
O3 Local MDX
Data Set Type:
O3 Data Set
- Enter the following MDX query for this new data set.
SELECT {[Measures].[Litros Vendidos], [Measures].[Venta Neta]} ON COLUMNS ,CROSSJOIN({[Vendedores].[Vendedor].members}, {[Vinos].[Vino].members}) ON ROWS FROM [Vinos]
This query generates a table containing:
- One row for each Wine sold by each Distributor
- For every combination of Wine and Distributor it will show 2 columns ( Litres sold and Net Sales measures)
The clause CROSSJOIN in the query is the one that enables the nesting of dimensions Distributors and Wines which also existed in the View.
Distribuidor
Vino
Litros Vendidos
Venta Neta
Distributor 1
Wine 1
10
1500
Distributor 1
Wine 2
15
2700
Distributor 2
Wine 1
13
1780
...
...
...
...
Distributor 3
Wine 3
12
720
For more details about syntax and options provided by the MDX language supported by O3 refer to Writing MDXqueries
Displaying when a datamart was last updated
Displaying the update time of a Datamart