Tuesday, 21 February 2017

Calculation View

Introduction

Calculation View are the composite view and can consume other view like Attribute view, Analytic View, Calculation view as well as table which is not possible in other views.
It can perform complex calculation which is not possible with the others views.

Type of Calculation view


1- Graphical Calculation View
2- Scripted Calculation View 

Creating Calculation View in SAP HANA

  1. Click on your Package --> New--> Calculation view
  2. Give the name of calculation view and other important details and click on next and finish
  3. After this next screen will look like this
  4. Now add 2 projection and add table into those projection and choose feilds which you want into those projection
  5. Now join both projection with the union
  6. Now last step is join union with the upper projection
  7. Now view the data for output


    For more information please drop me mail: sandeepcg1989@gmail.com

Monday, 6 February 2017

Sequence in SAP HANA

Sequence Introduction


A sequence is a database object that generates an automatically incremented list of numeric values according to the rules defined in the sequence specification. The sequence of numeric values is generated in an ascending or descending order at a defined increment interval, and the numbers generated by a sequence can be used by applications, for example, to identify the rows and columns of a table




Sequences are not associated with tables; they are used by applications, which can use CURRVAL in a SQL statement to get the current value generated by a sequence and
NEXTVAL to generate the next value in the defined sequence.

EX- suppose we want to change Row based table into column based table with a primary key as a sequence but in row based table there is no primary key.

Creating Sequence
  1. Import the table into Hana system go to File-->Import
  2. Fill all the details which is required
  3. Now on next screen put which type of table you want to create Row Based or Column Based
     
  4. Now it will show the output of table and click on Finish it will create Row based table into your schema Table folder
  5. Now we will create a sequence which will convert row based table into column based with a primary key
    below code will create one sequence which will increment

  6. Now create a column based table so we can convert out Row based Table to Column Based Table using Sequence
    Right click on your schema-->New Table create table with 2 column SPID & SP_NAME

  7. Run the below code so it can generate one column as a primary key and always incremented by 1
  8. Run the below code and see the output





    For more information and tutorials mail me 
    sandeepcts1989@gmail.com