Note On Creating Parameters
Note On Creating Parameters
Parameters are like calculated fields but more flexible and dynamic. These are invariably used in “what-
if” scenarios.
SIMPLE PARAMETER
Set data type to float, current value as 0, Display format as %, allowable values to range, minimum as -
0.1, maximum as 1 and step size as 0.05. Ok
The parameter is made and appears below the list of measures. Click the dropdown arrow and select …
show parameter to see it in the viz view.
For the parameter to work, it should be part of a calculated field. Let us make a calculated field, SALES
GROWTH with the formula
SUM([Sales])*(1+[GROWTH FACTOR])
Drag sub cat to columns and sales and sales growth to rows. Now you can use the slider on the
parameter to see how much sales will be in each sub cat if the sales grow (reduce) from -10% to 100%,
in 5% increments
Top N parameter
Customers to rows, Sales to columns. Sort for sales. Mark labels. Drop Customer name to filter.
In dialogue box, use “Top” button, input 10 in “By field”. If you apply you will see top 10 customers.
However, to make it dynamic, choose “create a new parameter” from the drop-down menu in box
where you inputted 10. In the dialogue box, input name of parameter, “Top Customers”, Choose Range
in allowable values, indicate current value as 10, min value as 5, max as 50 and step size of 50. Ok and
then Show Parameter. You can now control the number of top customers from 5 to 50 you want to see
by sales.
Try color for sales and convert to bubble chart for different way to visualize
In parameter box, Name: Sales/Profit, choose string and list. Input Sales, Profit in two rows – OK
WHEN “Sales” THEN [Sales], WHEN “Profit” THEN [Profit], END. Use correct cases.
Drop cat and sub-cat to rows shelf, 2-in-1 Measure to columns shelf. Show parameter
you can use the parameter control to switch back and forth between profit and sales
Demonstrate Sales/Profit dashboard: parameter title etc. can be formatted by rt clk and format
Create a parameter “Dimension Switcher”. Integer – values 1,2,3, and Display as Segment, Category and
Sub-category. OK. Now create calculated field “Segment/Category/Sub-category”.
END. (You don’t need to enclose 1 etc. in quotes since we used “Integer” in parameter box)
Use Profit for columns and the calculated field in rows shelf. Show parameter.
Drop “Discount on rows shelf and Category and Sub-category on columns shelf. Bar chart is created. The
default aggregation is ‘sum’ which does not make sense for discounts. Change the aggregation to
‘Average’. Now we see the bar chart showing the average discount being offered in each category/sub-
category
Go to “Create a Parameter” – Name it ”BaseLineDiscount”. Put 0.30 in current value field if the current
base line discount offered by the company is 30%. change the allowable values from “All” to List. Enter
values 0.10, 0.20, 0.30, 0.40, 0.50 and display as 10%, 20%, 30%, 40% and 50% in separate rows. Ok.
Go to Analytics PANE – Custom– Drag reference line to chart area – choose Table
In dialogue box, change the Value from Avg(Discount) to the name of the parameter
Now the chart shows which sub-cat items are above or below the baseline discount. In the parameter
drop-down, you can change the baseline discount value to move the reference line up or down.
To show colors for values above and below ref line, make a calculated field “Discount above/below”.
Formula AVG ([Discount]) > [BaseLineDiscount].
Drop this calculated field (in measures) to color. Edit colors – red for true and green for false. Now you
can see red bars for categories that have average discount above the baseline discount. By choosing a
different value of base line discount in the parameter, the colors of bars will change accordingly.
DYNAMIC MOVING AVERAGE PARAMETER
We talked about changing the level of aggregation from sum (default) to average or moving average, to
better appreciate the time series data. But we need to edit the moving average calculation to change
the range of average window. A parameter can be incorporated to do this on the fly.
Create a parameter TIME PERIOD – data type to integer, , allowable values to range, current value to 10,
minimum to 2 and maximum to 30, step size to 1. Show parameter
Now use order dt (month-green) as column, sales and moving average to rows to see sum of sales and
moving average, that can be adjusted from a 2 day window to 30 by the parameter.