Databases Reference
In-Depth Information
Note that by default, the input has no link to the output—we have to define the
junctions ourselves.
In
Tools Palette
at the top of the graphical designer, we can see the types of building
blocks available for calculation views; in our example, we'll be using two
Projection
blocks
and a
Union
block.
The
Projection
blocks allow us to select only certain fields from the analytic view to use in
our calculation view—once more following the principle of "ilter the data as soon as possible
and work with as little of it as is necessary" in order to speed up calculations. The
Projection
block also allows us to add calculated columns—these are the same as calculated attributes
or measures in the analytic view; however, they are visible only in
this
calculation view, not
everywhere the analytic view is present.
In order to combine the results of the two analytic views, we need to either add a
Join
or a
Union
block to the calculation view. Both of these can do the job of combining the data;
however, since we need no special handling of the data (for readers who are familiar with
SQL, we do not need a special join type, we're just doing a regular inner join), a
Union
block
is recommended by SAP as it's faster.
The first thing we need to do is add a
Projection
block to the view, then link the upper junction
of our "real data" analytic view to the lower junction point of the
Projection
block—simply by
dragging a line between them. The junction points are the small circles at the top and bottom
of the blocks. Click inside the circle of the source block, and drag to the circle of the destination
block, as shown in the following screenshot:
Note the direction of the arrow! Also be careful to work on the first analytic view we created,
not the projected sales view—we'll get to that one in a minute.
Once this is done, click on the
Projection
block, and we are given the list of fields in the analytic
view; here we can choose with which fields we would like to work.
As usual in the SAP HANA Studio, right-click on a field name, and choose
Add to Output
to select a field. To remove a field added in error, right-click on it in the
Output
pane, and
select
Remove
.
In our simulator, we'll be working with the
ORDER_YEAR
,
CUST_NAME
, and
ORDER_AMT
fields, so please add these to the
Output
pane.