Custom Views are similar to tables and are generated using SQL “CREATE VIEW” statements, which provide for a great deal of flexibility in terms of the joins and groupings that can be used, as well as all the other SQL functionality and syntax that are available.
Adding a Custom View
To add a custom view, follow the steps below.
- Expand the relevant data area, right-click Views and then click Add Custom View.
- In Name as in script box, type the name of the view, which must be the same as the name specified in the script, including the schema.
- Enter the create statement for the view using the standard SQL syntax. Drag tables, fields and variables from the list in the right-hand pane to use them as parameters. Fields entered as parameters can be mapped to the view's fields to enable documentation and data lineage - for more information see the section on Mapping Custom View Fields below.
- Click OK to save the view.
- Deploy the view
- Right-click the view and select Read View Fields.
- Expand the view to show the fields, and then right-click the view and select Preview View to double-check that the view is working properly.
Adding a Custom View Based on a Table
To add a custom view based on an existing table, drag the table to the Views node in a data area.
Editing a Custom View
In order to change the view:
- Right-click on the Custom View and select Edit Custom View
- Make the changes to the create statement and click OK
- Right-click on the Custom View and select Deploy
- Right-click on the Custom View and select Synchronize View Fields
Mapping Custom View Fields
Since a custom view is very flexible, the relationship between the parameterized 'input' fields and the view's fields cannot automatically be mapped. This means that documentation and visualizations, such as data lineage, cannot automatically trace a field from data source to destination if it passes through a custom view. However, documentation and data lineage through custom views can be achieved with some manual mapping.
To map the custom view's fields to the parameterized fields, follow the steps below.
- Make sure the fields have been read, then right-click the view and click Map Custom View Fields.
- Drag each field from the View fields list to one or more fields in the Parameter fields list to create mappings. To delete a mapping, click the mapping and then click Delete. Click Auto Map to map fields automatically based on name.
- Once all view fields have been mapped, click OK.