Creating parameters

Parameters allow more interaction with the reader by allowing him/her to change certain values and see how this impacts other measures. By creating parameters, the reader can be put in charge of evaluating various what-if scenarios or given options to choose the number of items to view.

Getting ready

Let's use the sample file Sample – Superstore Sales (Excel). Open a new worksheet and select Sample – Superstore Sales (Excel) as the data source.

How to do it...

Once the data is loaded on the worksheet, perform the following steps to create a parameter, and use it to dynamically adjust the visualization:

  1. Click on the Show Me button to bring the Show Me toolbar on the screen.
  2. While holding the Ctrl key, click on Sub-Category and Region from Dimensions, and Profit from Measures.
  3. Click on the horizontal bars icon on the Show Me toolbar.
  4. Right-click on Profit from Measures and select Create Parameter.
  5. In the Create Parameter dialog box, enter Profit Goal in the Name textbox.
  6. Change the Display format to Currency (Standard) as shown in the following screenshot:
    How to do it...
  7. Check the Step size checkbox and enter 1000.
  8. Select OK.
  9. Right-click on the newly created parameter Profit Goal, and select Create Calculated Field.
  10. In the Calculated Field dialog box, in the Name textbox, enter Met Profit.
  11. In the Formula box, enter the IF [Profit] >= [Profit Goal] THEN 'Y' ELSE 'N' END formula as shown in the following screenshot:
    How to do it...
  12. Select OK.
  13. Drag-and-drop the newly created calculated field Met Profit Goal in the Color box into the Marks pane.
  14. Right-click on the Profit Goal parameter and select Show Parameter Control as shown in the following screenshot:
    How to do it...
  15. Change the values of Profit Goal using the slider or left and right arrow buttons as shown in the following screenshot:
    How to do it...
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset