In this case study, filtering, sorting and extracting data from the wizard and using ${view:ViewName.Selection} will be covered. The idea of this dashboard is to select a product_id from a Grid element and a Table element will display records with the selected product_id. The border title for the Table element will display the product_id selected.
Query Builder button and use the table named
sales_fact_1997. Select all the fields. Infer the schema and end the wizard.
Finish
button.
Add Grid. When the wizard appears, click on the Next
button twice. In the Expression Builder, enter 100 in the Amount
field. Then, click on the Set Value button. This will extract the top 100 data from
the datasource. Click on Next twice.
product_id. Finally, exit from the
wizard by clicking on the Finish button.
Sales as the border title.
Add Table. At the second page of the wizard, you will see the
parameter defined in the datasource. Under Value, change ${id}
to ${view:Sales.selected:product_id}. This will pass in the value selected by the user
from the Grid element to Sales_param.ds as a parameter. The Table element will display the respective
results.
Add icon. Select
product_id and Ascending for the Name and Sort Order respectively.
This will sort the data according to the product_id in ascending order.
Next button twice. Over here, you will be able to do some filtering of
data. Under When of promotion_id, select
Not Equals. As for the Condition, enter the value
0. This will filter away all the records where the
promotion_id is zero. Finally, click on Finish to exit from
the wizard.
Initial Selection to the Grid element.
With Initial Selection, the Table element will have a value to pass to
the datasource when it loads.
Initial Selection, right-click on the Grid element and select
Initial Selection.... You will then see the Initial Selection Wizard
like Figure 2.20, “Initial Selection Wizard”. Select Select First on Refresh. For the
Field, select customer_id. Click on
Finish. With this setting, the first record of the Sales element
will be selected (based on customer_id) each time the view is
refreshed.
Presentation.... The default value for Border Title is
${ContentName}, which is the name of the element in the perspective. This name
is editable at the properties of the element. To change it to reflect the selected
product_id, enter ${view:Sales.selected:product_id}
in the Border Title field. Click on Finish to exit from the wizard.