Difference between revisions of "Driving Grids from an Excel Range"

(Example)
(Example)
Line 5: Line 5:
 
==Example==
 
==Example==
  
Here’s a simple grid:
+
==Example (based on the [[BicycleSales Demo Cube|Bicycle Sales cube]])==
  
[[Image:DrivingGrid1.png|center|300px]]
+
We will create a dropdown to automatically switch the {{Code|Time}} dimension of our Grid.
  
We will change it to use an Excel range to drive which calendar periods are displayed.
+
<ol>
 
+
<li>Insert a Grid based on the Bicycle Sales demo cube, starting from {{Code|A7}}. Select {{Code|Time}} and {{Code|Measures}} on Slicers, {{Code|Region}} on Columns and {{Code|Product}} on Rows.</li>
We will set up cell E2 as the Excel range:
+
<li>In cells {{Code|B3}} to {{Code|B5}}, we enter the years we want to analyse:</li>
 
+
[[File:DrivingGridExample1.png|center|300px]]
[[Image:DrivingGrid2.png|center|300px]]
+
<li>To create a validation dropdown cell:</li>
 
+
<ol type="a">
Now edit the Calendar Date hierarchy to use E2 as its input. Click on the Excel range button and select E2 as the driving range:
+
<li>Select the {{Code|B2}} cell for the dropdown</li>
 
+
  <li>Select the Data Validation ribbon item:</li>
[[Image:DrivingGrid3.png|center|300px]]
+
[[File:DrivingGridExample2.png|center|300px]]
 
+
<li>Choose a '''List''' type validation, and enter {{Code|=$B$3:$B$5}} as the source:</li>
The selected range is added to the list of selections:
+
[[File:DrivingGridExample3.png|center|300px]]
 
+
<li>Click '''OK''', and the dropdown will be created in cell {{Code|B2}}:</li>
[[Image:DrivingGrid4.png|center|300px]]
+
[[File:DrivingGridExample4.png|center|300px]]
 
+
</ol>
Click OK.
+
<li>Now we need to drive the Grid from the dropdown cell:</li>
 
+
<ol type="a">
The grid will update to use the new range for the Date Calendar hierarchy.
+
<li>Double-click on the {{Code|Time}} label to display the Hierarchy editor.</li>
 
+
<li>Click on the '''Excel Range''' button, and choose {{Code|B2}} for the driving range:</li>
[[Image:DrivingGrid5.png|center|300px]]
+
[[File:DrivingGridExample5.png|center|300px]]
 
+
  <li>The selected range is added to the list of selections:</li>
Similarly, we can use an Excel range to drive the grid rows:
+
[[File:DrivingGridExample6.png|center|300px]]
 
+
<li>Click '''OK'''
[[Image:DrivingGrid6.png|center|300px]]
+
</ol>
 
+
<li>The Grid will update to use the new range for the {{Code|Time}} hierarchy. Because the range is currently empty, the Grid seems to be unaffected, but if we now use the dropdown to switch the year to {{Code|2003}}, we'll see the Grid update:</li>
Now edit the Geography hierarchy to use E2 as its input. Click on the Excel range button and select E2 as the driving range:
+
[[File:DrivingGridExample7.png|center|300px]]
 
+
<li>As you can see, the validation list range can be hidden to keep the report tidy.</li>
[[Image:DrivingGrid7.png|center|300px]]
+
<li>Even after drilling the Grid, the driving cell is still maintained:</li>
 
+
[[File:DrivingGridExample8.png|center|300px]]
Click OK.
+
</ol>
 
 
The grid will update to use the new range for the Geography hierarchy.
 
 
 
[[Image:DrivingGrid8.png|center|300px]]
 
 
 
Additionally, you can change the selection to include children, descendants etc:
 
 
 
[[Image:DrivingGrid9.png|center|300px]]
 
 
 
Let’s select Children:
 
 
 
[[Image:DrivingGrid10.png|center|300px]]
 
 
 
Click OK and the grid will now show all children (states) of the selection in E2, currently United States.
 
 
 
[[Image:DrivingGrid11.png|center|300px]]
 
 
 
Let’s update E2 to be Germany (by typing straight into E2) – the grid now shows all German states:
 
 
 
[[Image:DrivingGrid12.png|center|300px]]
 
 
 
The Excel range can also be across a number of cells:
 
 
 
[[Image:DrivingGrid13.png|center|300px]]
 
  
 
==Further Exercises==
 
==Further Exercises==

Revision as of 11:40, 23 March 2016

For many standard reports, you will want to use data from the Excel workbook to influence your Grids. Driving dimensions from a range provides a simple way to do this, especially when multiple Grids need to use the same parameters.

If the input to the Grid can contain members that aren't found in the Cube, then the error message that is shown for invalid members can be hidden. See the Grid Properties Display error on invalid members option.

Example

Example (based on the Bicycle Sales cube)

We will create a dropdown to automatically switch the Time dimension of our Grid.

  1. Insert a Grid based on the Bicycle Sales demo cube, starting from A7. Select Time and Measures on Slicers, Region on Columns and Product on Rows.
  2. In cells B3 to B5, we enter the years we want to analyse:
  3. DrivingGridExample1.png
  4. To create a validation dropdown cell:
    1. Select the B2 cell for the dropdown
    2. Select the Data Validation ribbon item:
    3. DrivingGridExample2.png
    4. Choose a List type validation, and enter as the source:
    5. DrivingGridExample3.png
    6. Click OK, and the dropdown will be created in cell B2:
    7. DrivingGridExample4.png
  5. Now we need to drive the Grid from the dropdown cell:
    1. Double-click on the Time label to display the Hierarchy editor.
    2. Click on the Excel Range button, and choose B2 for the driving range:
    3. DrivingGridExample5.png
    4. The selected range is added to the list of selections:
    5. DrivingGridExample6.png
    6. Click OK
  6. The Grid will update to use the new range for the Time hierarchy. Because the range is currently empty, the Grid seems to be unaffected, but if we now use the dropdown to switch the year to 2003, we'll see the Grid update:
  7. DrivingGridExample7.png
  8. As you can see, the validation list range can be hidden to keep the report tidy.
  9. Even after drilling the Grid, the driving cell is still maintained:
  10. DrivingGridExample8.png

Further Exercises

  • Drive a second hierarchy: perhaps the Product hierarchy
  • Drive a second Grid from the same cell, and watch as both Grids change at once
  • Drive the Grid from formulae