Using a Presentation Variable in a Static Text View
Using a Presentation Variable in a Static Text View
Create an analysis that uses the VarSalesRep presentation variable in a Static Text view and in a Filter.
A Static Text view adds static text in the results.
A Static Text view adds static text in the results.
1. | Create an analysis by selecting the following columns:
|
---|---|
2 . | Add ascending column sorts in this sequence: C50 Region, C52 Country Name, and E1 Sales Rep Nameas shown below: The Criteria tabbed page should look like this after adding the sorts: |
3 . | Select the Results tabbed page. |
4 . | Select New View > Other Views > Static Text. |
5 . | Move the Static Text view above the Table view. Click the Edit View icon on the Static Text view. The Static Text editor appears. |
6 . | In the Static Text editor, reference the VarSalesRep variable. Enter the following syntax in the Static Text pane: This analysis is for the Sales Rep @{VarSalesRep}. The syntax for referencing a Presentation variable is as follows:
@{variables.variablename}[format]{defaultvalue} or @{scope.variables['variablename']}
Observe that your entry is previewed below the Static Text text box. Click Done. |
7 . | Save your analysis as Sales Reps by Region and Country. Your analysis should look like this: |
8 . | a. Select the Criteria tabbed page. b. In the Filters pane, click the Create a Filter icon and select “Sales Person “.”E1 Sales Rep Name “. |
9 . | a. In the New Filter dialog box, click Add More Options and select Presentation Variable. b. In the Variable Expr field, enter the variable name, VarSalesRep. Notice that you can also specify a default for the variable, but in this case the default is driven by the variable prompt, which is set to default to “Angela Richards”. c. Click OK. The filter should look like this: |
10 . | Select the Results tabbed page. Because the variable dashboard prompt has not been run, the VarSalesRep presentation variable has not been populated with a value. Because of this, no results from the analysis meet the filter requirement. Save the analysis. |
11 . | Add the analysis Sales Reps by Region and Country and the newly created variable prompt to the Customer Detail dashboard. |
12 . | Open the dashboard Customer Detail from the Regional Revenue folder, then click Page Options > Edit Dashboard. |
13 . | Add a new column next to Column 1, and then navigate to the Sales Reps by Region and Country analysis and drag it to the new column. |
14 . | Navigate to SalesRep Variable Prompt in the catalog pane, and drag the prompt above the Sales Reps by Region and Country analysis. Save the dashboard and run it. The Dashboard view looks like this: |
15 . | Click the Collapse icon for the first column to minimize it. The dashboard runs and the variable dashboard prompt is preset to the default value, Angela Richards, which in turn appears in the Static Text view as expected and is used to filter the embedded analysis results. The value of a presentation variable is populated by the variable prompt. That is, each time you select a value in the variable prompt, the value of the presentation variable is set to that value. |
Click the drop-down list for the dashboard prompt, and select Chris Jones. Click Apply. The dashboard displays the presentation variable as Chris Jones. This concludes the topic of Presentation Variables and Filters. |
No comments:
Post a Comment