instantOLAP Tutorial 2.2.7 - The query

The query

Create new a query-file

Creating a new query is similar to creating a configuration. Use the button "New query" of the context menu of your folder. After using the menu item, a new wizard will appear.

When creating a new query, you must supply some mandatory information in the wizard. The most important setting is the cube the query should be based on. The wizard will preselect the first configuration in the same folder as the default configuration. Because there is only one in the folder, you can choose the selected configuration and press the "Next >>" button.

You also can set the filename, the name (this is the short name of a query shown in the navigation) and the title (which is displayed as the title of a query when it is executed). Only change the filename to "lesson1.query".

After you used the "Finished" button, a new window will open, this time showing the query-editor.

Add a fact to the pivot-table

The new query contains by default an empty pivot table with no header in the x- or y-axis. You can add new headers (which will define the rows and cells of your query) by dragging them out of the model-explorer at the upper left side of the Workbench. Facts are shown as a small yellow rectangle (containing a summary-sign) in the explorer after you opened the "Fact" dimension - there you should see the fact named "Quantity".

Drag this fact to the empty header at the X-axis (where the text "drop columns here" is displayed).

The new header is now placed in the x-axis of your table and will generate a column when the query is executed.

Add a dimension to the pivot-table

Beside the fact in the X-axis we also want to generate rows - e.g. one row for each member stored in our product dimension. Double-click the product dimension in the model explorer to open it and see its contents. Now you can see (and open) the root-key of the dimension, its levels and some predefined formulas (formulas are shown as a small yellow rect containing an "f()").

The level "PRODUCT" of the product dimension is displayed with the level-symbol (containg three dots in a row). Now drag this level to the y-axis of your pivot-table.

In difference to the fact you added to the table before, this new header will not only create a single header but one header for each single product stored in the product dimension.

Test your query

Now your first query is finished, showing on row for each product and a column containing the fact "Quantity". Use the "Preview" tab at the bottom of the editor to execute the query and to preview its result.

Because there is not data for every single product stored in the fact-table, some of the rows will be empty. Also, the products are displayed with their technical IDs because we used the IDs to generate the dimension. The following lessons will show how to display the products-names instead of their IDs and how to supress the empty rows.

Save your query

Don't forget to save your query before continuing your work. Like in the configuration-editor before, you can use the "Save" button of the Workbench to save the query.

Getting started
Tutorial
Lesson 1: Creating a simple configuration and query
The configuration
The query
Lesson 2: Adding a display-text to the dimenson
Lesson 3: Creating a dimension with a hierarchie
Lesson 4: Adding a time-dimension