Creating an SQL List
Note: You must have a data table or chart that contains at least one parameter for your filter control to function correctly.
When you create an SQL List, you are using an SQL query to dynamically retrieve a list of display names and corresponding values directly from a relational database as shown in the example below:
Note: You must have administrative permission to create SQL-based filters.
Follow the instructions below to create a SQL List:
1. In the dashboard page, under General Settings, select Prompts. The Filter Editor appears on the right. No filters are listed if this is the first time you are assigning filters.
2. To display a filter toolbar to users of the dashboard, enable Show Filter Toolbar. A placeholder for the filter toolbar appears at the top of the dashboard.
3. Click (Add) to add a filter. The
Prompt dialog box appears.
4. In the Prompt dialog box, enter a Name for your filter.
5. Enable the Display Name as Control Label, if appropriate.
6. Click the appropriate icon to select your filter control. In the example above, the Radio Button control was selected.
7. Under Type, select SQL List.
8. Select the data source (Connection) that contains the content you need to set options from the drop-down list.
9. Click (Edit) to display the Query input text box. 10. Type the SQL query in the area provided for you. If you enter a parameter query, use the following format ${parametername} and provide a default value for the parameter.
11. Click Test to ensure that your SQL query is displaying the correct values.
Note: Use a SQL query that returns two columns — one for the display name and one for the value.
12. Adjust your SQL query as needed and click OK.
13. Under Control Properties, enter a Default Label/Value for the initially selected option in your filter control.
14. Select a Label to display in the filter control; this is the user-friendly name that users will see in the dashboard.
15. Select the Value; this is the field that is passed as the parameter's source value.
16. If applicable, select your Display type from the list.
Note: Some filter controls allow you to choose the position of your filter options. If you have a long list of options, for example, a list of cities, you can change the Display type to horizontal.
17. Click OK.
The list of values appears in the filter toolbar in the dashboard.