In this section: |
You can sort the data in an OLAP report based on the values of dimensions in the hierarchy and/or the values of the quantitative measures that constitute the body of the report. Sorting options vary depending on the nature of the data being sorted. For details, see Sorting Measures and Sorting Dimensions.
You can also group numeric data into any number of tiles (percentiles, quartiles, deciles, and so on). See Grouping Numeric Data Into Tiles.
How to: |
You can apply aggregation and sorting simultaneously to a numeric measure in an OLAP report, and sort the data from high to low (descending order) or from low to high (ascending order). All other columns are sorted correspondingly.
For the measure being sorted, you can restrict the report to a specified number of highest values (when sorting high to low) or lowest values (when sorting from low to high).
When you sort a measure, any subtotals, subheadings, or subfootings in the report are automatically suppressed since these elements relate to a specific sort field and are not meaningful when the report is resorted by the values in a measure column. For an illustration, see How to Applying a Percent Calculation to a Measure.
Note: Sorting by measures is not available in a report in which measures have been stacked. See Hiding and Displaying Measures.
To sort the values of a measure from high to low:
or
The report runs automatically. The highest value is now first in the column. The top of the diamond button becomes solid blue to indicate the current sort direction.
To sort the values of a measure from low to high:
or
The lowest value is first in the column. The bottom of the diamond button becomes solid blue.
Tip: After a measure has been sorted once, clicking the upper or lower half of the diamond button inverts the sort order of that measure. Place your mouse pointer over either half of the diamond to see a message that indicates the next sort order that will occur if you click the diamond.
The OLAP report shows sales information sorted by quarter, store, and Product Type.
You are interested in seeing where the greatest quantity of goods has been sold.
As shown in the following image, the report now displays data values for the Quantity measure in descending order. The top half of the diamond next to Quantity is blue and solid to indicate the current sort order of the measure. This is now the controlling sort in the report. All other values are reordered correspondingly.
Tip: To invert the sort order, click the diamond button again.
Do not click the Stack Measures check box, which controls the display of a measure, not its sorting.
The sort pane is replaced by the Measures pane, where the measure becomes blue to indicate that sorting specifications have been defined.
The diamond button next to the sorted measure changes to reflect the sort order. If the sort order is high to low, the top half of the diamond is solid blue. If the sort order is low to high, the bottom half is solid blue.
Note:
You can select to view only a subset of the total number of records in your report.
Do not click the Stack Measures check box, which controls the display of a measure, not its sorting.
or
The default number of sort field values is 5.
The sort pane is replaced by the Measures pane, where the measure becomes blue to indicate that sorting specifications have been defined.
The report shows sales information sorted by quarter, store, and Product Type.
The sort pane opens, as shown in the following image.
High to Low sorting is selected by default.
Because the report is being sorted from high to low, you can indicate the number of values you wish to see, beginning with the highest.
The main OLAP Control Panel window appears. In the Measures pane the Quantity measure is blue, indicating that sorting specifications have been defined.
As shown in the following image, the report now displays Quantity sorted from high to low with the highest four values appearing.
You can remove sorting specifications for a measure whether the measure appears or is hidden.
There are several ways in which you can sort dimensions in an OLAP hierarchy:
The sort pane opens.
The main OLAP Control Panel window reopens.
In the report, the values of both sort fields (Continent and Region) are sorted from low to high (A to Z), as shown in the following image.
The sort pane opens.
The main OLAP Control Panel window reopens.
The main OLAP Control Panel window opens.
Both dimensions are now sorted in reverse alphabetical order (Z to A), as shown in the following image.
The sorting pane opens.
The main OLAP Control Panel window reopens.
The sort pane opens.
The main OLAP Control Panel window reopens.
Information for all stores is shown for each quarter. You want to see quarterly information for only the first two stores in alphabetical order (low to high).
The sort pane opens.
The following image shows these three selections on the OLAP Control Panel.
Notice that only two values now appear for each Quarter and they are ranked low to high within each group, as shown in the following image.
You can change the order in which data is sorted and presented in the report. For example, you can change from sorting by State and then by Product to sorting by Product and then by State. If you want to reposition:
In each case, the cursor changes to a plus sign (+) to indicate acceptable places into which you can drop the field. Unacceptable positions are shown by a circle with a slash across the center.
The dimension values adjust accordingly. The report now shows the Quantity values from high to low, but according to the QUARTER sort order, as shown in the following image.
You would like to change the sort order in the report, making Store Name the first sort field, followed by Product Type and QUARTER.
The cursor changes to a plus sign (+) to indicate acceptable places into which you can drop the field.
The report changes immediately, as shown in the following image, with the Store Name being the first sort order.
Repeat for other fields as needed.
The dimension values adjust accordingly. The report now shows the Quantity values from high to low, but according to the QUARTER sort order, as shown in the following image.
You would like to change the sort order in the report, making Store Name the first sort field, followed by Product Type and QUARTER.
QUARTER is now the third item in the Drill Down list, as shown in the following image.
QUARTER appears in the third column of the report, as shown in the following image.
In OLAP, you can hide a sort field by clicking the Hide check box in a report.
Note: Hidden sort fields are indicated by reversing the color of the icon that appears at the left of the field name.
-OLAP ON TABLE FILE CAROLAP SUM CAROLAP.BODY.DEALER_COST CAROLAP.BODY.RETAIL_COST BY CAROLAP.ORIGIN.COUNTRY BY CAR END
Notice that the color of the sort icon has been reversed. The Drill Down pane now appears, as shown in the following image.
You can quickly change a field from one that sorts data vertically, creating rows, to one that sorts data horizontally, creating columns, or vice versa.
To change a:
In each case, the cursor changes to a plus sign (+) to indicate acceptable places where you can drop the field. Unacceptable places have a circle with a slash across the center.
The report is now sorted vertically, by month, store, and Product Type, as shown in the following image.
You want to create a matrix in which data is sorted horizontally by month, and vertically by store and Product Type.
The cursor changes to a plus sign (+) to indicate acceptable places where you can drop the field.
In the new report, Quantity and Line Cost of Goods Sold are repeated horizontally for each month, as shown in the following image.
You can change a field from one that sorts data vertically, creating rows, to one that sorts data horizontally, creating columns, or vice versa.
The report is now sorted vertically, by month, store, and Product Type, as shown in the following image.
You want to create a matrix in which data is sorted horizontally by month, and vertically by store and Product Type.
MONTH moves into the Drill Across pane, as shown in the following image.
In the new report, Quantity and Line Cost of Goods Sold are repeated horizontally for each month, as shown in the following image.
The sort pane opens.
The main OLAP Control Panel window reopens.
Tip: To expose the hidden sort field, repeat the process and deselect the Hide check box.
The first sort field in the report is QUARTER. You want to retain the sorting but not display this field.
The sort pane opens.
The main OLAP Control Panel window reopens.
Report sorting is unchanged, but the QUARTER column no longer appears, as shown in the following image.
How to: |
You can group numeric data into any number of tiles (percentiles, deciles, quartiles, and so on) in tabular reports. For example, you can group student test scores into deciles to determine which students are in the top ten percent of the class.
Grouping is based on the values in the selected vertical (BY) field and data is apportioned into the number of tile groups you specify.
The following occurs when you group data into tiles:
1
5
5
5
8
9
In this case, dividing the instances into groups containing an equal number of records produces the following table:
Group |
Data Values |
---|---|
1 |
1,5 |
2 |
5,5 |
3 |
8,9 |
However, because all of the same data values must be in the same tile, the fives (5) that are in group 2 are moved to group 1. Group 2 remains empty.
The final tiles look like the following table:
Tile Number |
Data Values |
---|---|
1 |
1,5,5,5 |
2 |
|
3 |
8,9 |