Creating a Widget Using Predefined SQL
- Navigate to the widget builder.
- Optionally, click the Open/close filter panel icon
(
) in the upper-left corner to view the filters added to the dashboard and make changes, if required.
- From the SQL Selector drop-down list, select an option
listed under Predefined SQLs.
The predefined SQLs are Oracle-defined named SQL queries, which display the requested data in the widget. When you select a predefined SQL query, the query is displayed for your reference in the SQL Query field. Click the tooltip adjacent to the SQL Selector drop-down list to view a description.
- Optionally, select the Convert to Custom SQL check box to convert the predefined SQL query into a custom SQL query and customize it. On selecting this check box, the index values mapped to the input parameters in the SQL query are displayed in Parameter Index Mapping adjacent to the SQL query and the configured widget inputs are displayed in the Settings tab in the lower-right corner. For information on working with custom SQL queries, see Creating a Widget Using Custom SQL.
- In the Settings tab in the lower-right corner, click the
Edit icon (
) adjacent to the widget inputs to configure the input and display relevant data in the widget, if required. Note that the list of required inputs are denoted by an asterisk.
For example, if you select Group - Incidents count of last 7 days in the SQL Selector drop-down list, then the Group Type and Group Name widget inputs are listed in the Settings tab and must be configured. Here is how you can configure the widget input parameters for Group - Incidents count of last 7 days:
- Click the Edit icon (
) adjacent to the Group Type input in the Settings tab.
- In the Configure Group Type input for Untitled
Widget (Required) dialog, specify the Group
Type input in one of the following sections:
- Default settings: Review the default configuration settings for the input and select a filter. By default, the Allow widget users to link the Group Type input with a filter and Allow widget users to specify the Group Type input check boxes are selected and you can select a default filter and a value to link the input with an available filter. This is useful when the widget is added to a dashboard that uses the same filter, and this configuration setting will apply to future widgets.
- Configure widget input:
Select one of the following options to configure specific inputs
that will only apply to this widget:
- Link the Group Type input with an existing filter: Select this option to link the input with an existing filter. Note that this option is only displayed if a filter is already added to the dashboard in which you are creating the widget.
- Specify the Group Type input: Select this option to specify a fixed value as the input for the widget.
- Not configured: Select this option to leave the input unconfigured.
- Click Save changes to save the configuration for the Group Type input.
On configuring the Group Type input, the Edit icon (
) adjacent to the Group Name input is enabled and you have to perform the same set of steps to configure it. After the input parameters are configured, data is displayed in the widget. Below the widget, a table with the various attributes of the raw data for the widget is displayed and you can click Hide raw data to hide it.
- Click the Edit icon (
- Use the other tabs in the lower-right corner to perform the following
tasks:
Note:
You can click JSON in the upper-right corner to specify or edit the details on the About, Visualization, and Settings tabs, in a JSON editor. The JSON editor provides you with greater flexibility and more options to visualize data in the widget, however, it's recommended that you use it only if you are familiar with editing widget JSON. For more information on the JSON editor, contact Oracle Support.- About: Add a name and description for the widget.
- Visualization: Select a chart type
and customize the visualization by specifying or modifying additional
options.
If you select Table as the chart type, then you have the option of removing some of the columns or select the All Columns check box to display all columns. Chart types that have Y and X axes, such as the Line chart have the following additional visualization options:
- Y Axis: Select the data attribute you want projected on the Y axis. Y axis supports numeric data attributes and only those are listed.
- X Axis: Select the attribute of the data you want projected on the X axis.
- Series: Select the data
attribute that you want to plot in separate series in the chart.
Typically, the
GROUP BY
clause in a custom SQL query can be used for series. This option is also available for a Pie chart. - Color By: Select the data attribute for which you want to view color distinct values in the chart. This option is also available for a Pie chart.
- Y Axis Title: Specify a title for the data attribute projected on the Y axis.
- Legend: Specify the location of the legend in the widget. This option is also available for a Pie chart.
- Stacked: Select this option if you want to stack the data attributes displayed in the chart, by color.
- Use solid color: When you use an Area chart for visualization, the area that represents the presence of data is covered in solid color. This option is selected by default.
- Click Save to save the widget.
After you save the widget, it is added to the dashboard and is also
listed in the Widgets tab. Click the icon in the upper-right corner of the widget and click
Edit to view the widget in the Edit
widgets tab and click Edit Widget to go to
the widget builder and edit the input parameters or visualization options.