28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Restriction: It is not allowed to add column views to the Data Foundation.<br />

b) If you want to query data from more than one table, in the Details panel context menu, choose Create<br />

Join, and enter the required details.<br />

Note: After creating the join, you can edit its properties like join type, cardinality, etc in the<br />

Properties view. You can choose to create Text Join between table fields in order to get languagespecific<br />

data. For example, consider that you have a product table that contains product IDs and<br />

no description about products, and you have a text table for products that has a language-specific<br />

description for each product. You can create a text join between the two tables to get languagespecific<br />

details. In a text join, the right table should be the text table and it is mandatory to specify<br />

the Language Column.<br />

c) Add the table columns to the output structure that is, the Semantics node that you want to use to define<br />

attribute data. You can define the attribute data by doing one of the following:<br />

○ Select the toggle button on the left of the table field.<br />

○ Right-click the table field, and choose Add to Output.<br />

d) If you want to specify a filter condition based on which system must display data for a table field in the<br />

output do the following:<br />

1. Right-click the table field, and choose Apply Filter.<br />

2. Select the required operator, and enter filter values.<br />

All the table fields that you have added to the output are automatically mapped as attributes.<br />

3. Define Key Attributes<br />

a) Select the Semantics node.<br />

b) In the Attributes tab page of the Column panel, select the required attribute and select the Type as Key<br />

Attribute.<br />

Remember: If there is more than one key attribute, all key attributes of the attribute view must<br />

point to the same table in the data foundation. The central table of the attribute view is the one to<br />

which all the key attributes point.<br />

Note: In case of auto-generated time attribute views, the attributes and key attributes are<br />

automatically assigned.<br />

4. Optional Step: Create Calculated Columns<br />

a) In the Output of Data Foundation panel, right-click Calculated Columns.<br />

b) In the context menu, choose New.<br />

c) Enter a name and description (label) for the calculated column.<br />

d) Select a data type for the calculated column.<br />

e) Enter length and scale for the calculated coulmn.<br />

f) In the Expression Editor enter the expression. For example, you can write a formula such as,<br />

if("PRODUCT" = 'ABC', "DISCOUNT" * 0.10, "DISCOUNT"). This means if attribute PRODUCT equals the<br />

string ‘ABC’ then DISCOUNT equals to DISCOUNT multiplied by 0.10 should be returned. Otherwise the<br />

original value of attribute DISCOUNT should be used.<br />

g) Choose OK.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Setting Up the Analytic Model<br />

Note: The expression can also be assembled by dragging and dropping the expression elements<br />

from the menus below the editor window.<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved. 107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!