You will now create a Calculation View. A calculation view can perform complex calculations joining different tables, standard views and even other calculation views as sources.
Project Explorer tab in SAP HANA Studio, right click on the project, then on
New and then look for the
Calcuation View under
SAP HANA / Database Development
Enter the name for your calculation view and click on Finish.
Add two projection nodes by dragging and dropping
Projection nodes from the Nodes lateral bar. These nodes will be used to join the parks to their Amenities and add a filter later.
Hover on the nodes and a + sign will appear on the right.
Click on it to select the one of tables (either Park or Amenities) to be projected. Repeat the same for the other table so you can select all of the fields for output. You can either click on the circle on the left of each individual field or right click on the top of the table node and select Add all to Output.
For the Amenities, leave out the
DescriptionText field from the output as it is not supported by this type of view.
Drag and drop a
Join node from the
Nodes bar on the left. To connect the tables, drag and drop the circles on the top of each
Projection node into the
Click on the Join Node to connect the key fields by dragging the
ParkID from the left into the
ParkID field from the right:
Add all the fields to output (except for the
ParkID field from amenities, to prevent it from being duplicate) and set the
Join Type to
Left Outer so that Parks that do not have any amenities are also included in the results.
Finally, drag and drop the circle on the
Join node into the
Aggregation node. Add all the fields in the Aggregation to Output and click on the
Use the Auto Assign button to automatically set the type (measure or attribute) for each field.
Auto Layout button at the bottom of the graphic model makes the diagram prettier.
Activate your view using the green arrow on the top:
And click on
Raw Data to see your results: