Select some dimension cells in a pivot table
Select some dimension cells of a pivot table by using the SelectPivotCells method. The type of the cells to select should be either L (for left dimensions cells) or T (for top dimension cells).
Examples
Example 1:
The definition of the hypercube is the following:
Regarding the above definition, the hypercube has the following properties:
- Is handled as a pivot table ("qMode": "EQ_DATA_MODE_PIVOT")
- Has four dimensions defined in the following order: CategoryName, ProductName, City and Customer.
-
The measures are Sum(OrderTotal) and Count(OrderTotal).
- Contains 3 left dimensions ("qNoOfLeftDims": 3) and one pseudo dimension (since the pivot table contains two measures).
- The cells are always fully expanded ("qAlwaysFullyExpanded": true).
- The inter column sort order is [0, -1, 1, 2, 3] which means that the pseudo dimension is at position 1.
- CategoryName, ProductName and the pseudo dimension are left dimensions.
- City and Customer are top dimensions.
1. Select the product Chang. Chang is a left dimension value (qType is L). qCol is set to 2 to select the left dimension ProductName. qRow is set to 1 to select the second product name value.
The client sends:
The engine returns:
The product Chang is selected.
2. Retrieve the values of the pivot table. The paging is composed of the first 5 lines (qHeight is 5) and 5 columns (qWidth is 5) starting from the top left (qTop is 0 and qLeft is 0).
The client sends:
The engine returns:
qLeft returns the following left dimension cells: Beverages, Sum(OrderTotal), Chang and Beverages, Count(OrderTotal), Chang.
qTop returns the following top dimension cells: München, Frankenversand, Frankfurt a.M., Lehmanns Marktstand, Köln, Ottilies Käseladen, München,Frankenversand, Cunewalde and QUICK-Stop.
qData returns the calculated data related to the product Chang.
For more information on the returned parameters, see GetHyperCubePivotData method.
3.Select the customer Ottilies Käseladen. Ottilies Käseladen is a top dimension value (qType is T). qRow is set to 1 to select the top dimension Customer. qCol is set to 2 to select the third customer value in the data matrix.
The client sends:
The engine returns:
The customer Ottilies Käseladen is selected.
4. Retrieve the values of the pivot table. The paging is composed of the first 2 lines (qHeight is 2) and 4 columns (qWidth is 4) starting from the top left (qTop and qLeft).
The client sends:
The engine returns:
qLeft returns the following left dimension cells: Beverages, Sum(OrderTotal), Beverages and Count(OrderTotal).
qTop returns the following top dimension cells: Köln and Ottilies Käseladen. The type (qType) of these values is N since they are dimension values.
qData returns the calculated data related to the customer Ottilies Käseladen. The type qType of the calculated values is V.
For more information on the returned parameters, see GetHyperCubePivotData method.
Example 2:
The hypercube is defined as follows:
Regarding the above definition, the hypercube has the following properties:
- Is a pivot table ("qMode": "EQ_DATA_MODE_PIVOT")
- Has four dimensions defined in the following order: CategoryName, ProductName, City and Customer.
-
The measure is Sum(OrderTotal).
- The inter column sort order is [0,1, 3, 2].
- Contains 3 left dimensions ("qNoOfLeftDims": 3).
- The cells are always fully expanded ("qAlwaysFullyExpanded": true).
- CategoryName, ProductName and Customer are left dimensions (according to the inter column sort order and the number of left dimensions).
- City is a top dimension (according to the inter column sort order (qInterColumnSortOrder ) and the number of left dimensions (qNoOfLeftDims)).
1. Select the product Lakkalikööri. Lakkalikööri is a left dimension cell (qType is L).qCol is set to 1 to select the left dimension ProductName; qRow is set to 1 to select the second product name value.
The client sends:
The engine returns:
The product Lakkalikööri is selected.
2. Retrieve the values of the pivot table. The paging is composed of the first 5 lines (qHeight is 5) and 4 columns (qWidth is 4) starting from the top left (qTop is 0 and qLeft is 0).
The client sends:
The engine returns:
qLeft returns the following left dimension cells: Beverages, Lakkalikööri and Alfreds Futterkiste.
qTop returns the following top dimension cell: Berlin.
qData returns the calculated data related to the product Lakkalikööri, the customer Alfreds Futterkiste and the city Berlin.
For more information on the returned parameters, see GetHyperCubePivotData method.