We have Order data. Each row is each order per each customer.
And we have a column that tracks how many times of the orders a given customer has done and a column that shows if the order is 'Repeat' order meaning the given order is the second or greater times from the same customer.
By using the 'Repeat Order' column, we have created a chart below that shows the percentage of the 'Repeat Order' among all orders in a given month.
Now, we can open the Calculation dialog to see how we define the 'Repeat Order'.
This would return TRUE if a given order is more than 2nd time order.
But what if you want to change this criteria to be 'more than 3rd time order' or 'more than 10th time order' for the order to be labeled as 'Repeat Order'?
This is one of those scenarios you want to parameterize the calculation, or replace the part of the calculation with a parameter.
First, let's create a Parameter. Click on the Parameter button at the right hand side top.
This will open the Parameter pane, at this point it's empty.
Click 'Configure Parameters' button at the top.
This will open the Parameter Setup dialog, click 'Create New Parameter' button.
Enter the Parameter Name and the Display Name, and select 'Numeric' for the Data Type.
For this example, we'll go with the 'Slider (Single Point)' as the Input Type.
Now, we want to set the range (Min and Max values) for the Slider parameter. You can type in fixed values if you are certain about the numbers. But you might want to set those values based on the actual data.
In such cases, you can select 'Get Values from Data Frame' and select the data frame you want to use this parameter for and select the column from which you want to get the Min and the Max values.
We can set the default value as 2 so that the Repeat Orders are the ones that are the 2nd time or more order per customer.
Once the setup is done, you can click on the Save button.
Now it's time to use it!
Open the Calculation dialog, and replace the original value (e.g. 2) with the Parameter you have just created.
You can type in '@' which will show a list of the parameters that are available in this project, and select the right one.
Click the Run button, which will replace the 'Repeat_Criteria' parameter with 2 because we have set 2 as the default value for this parameter.
Now you can update the Parameter and get different results in the chart.
Click the Parameter button to open the Parameter pane.
You can move the slider to see different results.
This is an example of using just the data. But you can embed the chart inside Dashboard or Note so that you can change the parameter values in the Dashboard or Note UI and regenerate the output with the updated data.
More often than not, you want to share this parameterized data with others so that they can change the parameter values, run the query, and get the corresponding data without asking you to update.
For this, you can publish the chart to Exploratory Server.
Once it's published, then open the published chart in the web browser.
In order to use the Parameter, you can turn on the 'Interactive mode' option.
And now you or others you have shared with can interact with the chart with the Parameter in the calculation!