0% found this document useful (0 votes)
9 views2 pages

Calculation View

Calculation View

Uploaded by

1nonlypriyo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Calculation View

Calculation View

Uploaded by

1nonlypriyo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Explore

A calculation view in SAP HANA is a virtual data model that allows you to perform
complex calculations on data from various sources. You can create graphical or SQL
Script-based calculation views using SAP HANA Studio or Eclipse 1.

A graphical calculation view consists of nodes that represent different operations,


such as projection, aggregation, join, union, and rank. You can drag and drop tables,
views, or other calculation views as data sources and map the columns to the output.
You can also define filters, variables, and parameters to customize the data selection
and calculation logic 23.

A SQL Script-based calculation view is a user-defined function that returns a table as


output. You can write SQL statements to manipulate data from tables, views, or other
calculation views. You can also use SQL Script features, such as control structures,
expressions, and procedures, to implement complex logic 1.

Here is an example of a graphical calculation view that aggregates the sales amount
by product category and region:
calculation view: SALES_BY_CATEGORY_REGION
output columns: CATEGORY, REGION, AMOUNT
aggregation node: AGGREGATE_SALES
data source: SalesItems table
mapped columns: CATEGORY, REGION, AMOUNT
aggregation type: MAX for AMOUNT column
Here is an example of a SQL Script-based calculation view that returns the top 10
customers by revenue:
calculation view: TOP_CUSTOMERS
output columns: CUSTOMER_ID, CUSTOMER_NAME, REVENUE
SQL Script:

CREATE FUNCTION TOP_CUSTOMERS ( )


RETURNS TABLE ( CUSTOMER_ID INTEGER, CUSTOMER_NAME VARCHAR(100), REVENUE
DECIMAL(15,2) )
AS
BEGIN
RETURN (
SELECT TOP 10 C.ID AS CUSTOMER_ID, C.NAME AS CUSTOMER_NAME, SUM(S.AMOUNT)
AS REVENUE
FROM CUSTOMERS C
INNER JOIN SALES S ON C.ID = S.CUSTOMER_ID
GROUP BY C.ID, C.NAME
ORDER BY REVENUE DESC
);
END;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy