Вы находитесь на странице: 1из 30

MODELING

Table:We have two types of tables 1) Row based Table 2) Column based Table 1) Row based Table: This table stores data in the form of combination of data in columns Create row table Provide command in SQL command Syntax is CREATE ROW TABLE <SCHEMA-NAME>.<TABLE-NAME>(COL1 <DATATYPE>NOT NULL PRIMARY KEY,COL2 <DATA-TYPE>NOT NULL, COL3 <DATATYPE>NOT NULL,COLn <DATA-TYPE>NOT NULL) Example CREATE ROW TABLE EFASHION_TUTORIAL.SHOP_FACTS ( SHOP_FACTS_ID INTEGER NOT NULL PRIMARY KEY, ARTICLE_ID INTEGER NULL, COLOR_CODE INTEGER NULL, WEEK_ID INTEGER NULL, SHOP_ID INTEGER NULL, MARGIN DOUBLE NULL, AMOUNT_SOLD DOUBLE NULL, QUANTITY_SOLD INTEGER NULL );

2) Column based Table: This type of table stores distinct data for every column to increase the reading performance. Create row table Provide command in SQL command Syntax is CREATE COLUMN TABLE <SCHEMA-NAME>.<TABLE-NAME>(COL1 <DATATYPE>NOT NULL PRIMARY KEY,COL2 <DATA-TYPE>NOT NULL, COL3 <DATATYPE>NOT NULL,COLn <DATA-TYPE>NOT NULL) Example CREATE COLUMN TABLE EFASHION_TUTORIAL.SHOP_FACTS ( SHOP_FACTS_ID INTEGER NOT NULL PRIMARY KEY, ARTICLE_ID INTEGER NULL, COLOR_CODE INTEGER NULL, WEEK_ID INTEGER NULL, SHOP_ID INTEGER NULL, MARGIN DOUBLE NULL,

AMOUNT_SOLD DOUBLE NULL, QUANTITY_SOLD INTEGER NULL );

Views:
View is used to combine the multiple tables and bring the data from specific columns View is mainly depends on JOINS We have 2 types of Joins Inner Join, Outer Join(Left, Right, Full) We have two types of Views 1) Row Views 2) Column Views 1) Row View Row view mainly depends on Relational We can create view on singe/multiple tables We can combine multiple tables by using JOINS We must take at least one column Here we cant create custom columns EX 1:Create View on singe table Right click on table and select New View Provide view name and schema name We will get Table in Data Foundation Drag required columns and execute

Ex 2:Create view on Multiple tables Select required tables so we will get multiple tables in data foundation If we want to add some more tables Click on Insert Table

If we want to add join click on Insert Join

Select Tables and column name for Join We can select type of join We have Inner, Left Outer, Right Outer, Full Outer join or we can join manually and set type of join as shown below Select required fields from table and click on execute. 2) Column Based View We have 3 types of views a) Attribute Views b) Analytic Views c) Calculated Views Before creating Views we need to create Package 1st Package: Package is like a folder which organizes Attribute, Analytic, Calculated views, procedures and Analytics We have two types of Packages i) Structural Package It helps to organize content in logical package tree, It contains only sub packages which eliminates the risk of objects creation in places where no content is desired ii) Non-Structural Package It contains only Information models and Sub-Packages

Provide name, description, Delivery unit(For deploying Project), Language, Person responsible (Language must be same as login language)

If it is nonstructural

If it is Structural

Column Views a) Attribute View Attribute view are used to generate repots in detail format. In attribute view we must have at least one Key Attribute Here we can create our own (custom) Attribute We can create Attribute in 4 ways

1) Standard To create normal custom Attribute 2) Time Dependent To create time related attribute 3) Copy Here we can create attribute view by copying already existed attribute. Here we can change structure of attribute 4) Derived Here we can create attribute view by copying already existed attribute. Here we can not change structure of attribute 1) Standard View(Single Table) Right click on Package Create new Attribute.

Provide Name, Description, Package and attribute type (Standard)

In Data Foundation(Tab) we will get table

If we want to add more tables click on ADD Table

Connect them by using join with join type and cardinality

select Required field right click on field and select ADD TO KEY ATTRIBUTE

Select required fields and right click and select Add as Attribute

So we will get key attribute and attributes under Attribute Folder in OUTPUT STRUCTURE

We can create custom Attribute to perform calculations on attributes which are available in Attribute Folder based on our requirement Right click on Calculated Attribute and select NEW

Provide Name, Description and Provide Data Type of Attribute, Length and Expression for both KEY and DESCRIPTION (TABS) NOTE:-Here we can use only Attributes which are available in Attribute folder in OUTPUT Structure.

We can maintain Two types of Hierarchies for Attribute View NOTE:-Here we can use only Attributes which are available in Attribute folder, Calculated Attributes in OUTPUT Structure Go to Hierarchy(Tab) click on Create provide name, Description and Type of Hierarchy 1) Level Based Hierarchy Drag and drop required Fields in order wise we can move up and down by clicking on Move UP, Move Down and we can remove object by clicking on Remove

2) Parent Child Hierarchy

Here we can select parent for Key Attribute.

And Activate and preview The Data

b) Analytic View It is OLAP View which is used to create reports on Transaction Data We must take at least one Fact Table Here we can take any number of Attribute Views based on Requirement but at least one column must be common Right click on Package create New Analytic View

Provide Name, Description Select Required table and Attribute Views

We will get table in Data Foundation(Tab) Select required fields and classify them as Attributes, Measure. Based on requirements we can create Calculated Attribute(To perform calculations on Attribute), Calculated measure(To perform calculations on Measures), Restricted measures(To restrict the measure values based on Attribute values), Variables(Objects to pass parameters dynamically at report level) Calculated Attribute is a column which is used to perform calculations on attributesRight click on Calculated Attribute and select NEW

Provide Name, Description and Provide Data Type of Attribute, Length and Expression for both KEY and DESCRIPTION (TABS) NOTE:Here we can use only Attributes which are available in Attribute folder in OUTPUT Structure.

Calculated Measure is a column to perform calculations on measures. Here we can provide currency. Right click on Calculated measure and select new Provide name, description aggregation type.

Go to Expression (Tab) Provide Data type, length, scale for measure, and provide expression for measure Select currency for measure Note: If we have any object for currency/unit we can select here

Note: If we dont have object for currency select option SIMPLE

Restricted Measureit is a column for measure which displays values based on Attribute values(Actually restricted measure which is used to display measure values based on Attribute values). Right click on Restricted Measure and select New provide name, description,

Aggregated type

Measure Click on Add Restriction Select 1) Parameter(Attribute) 2) Operators like(=, !=, <, >, <=, >=, Null, Is Not Null) 3) Values(Attribute values) 4) Include (If we enable include value system will bring selected values, If we disable Include system will bring all values except selected values{Exclude})

Variable is an object is used to pass attribute values reports dynamically Right click on variable select new

Provide name, description, Data Type, length, scale(optional{based on data type}),

If we select attribute select attribute (column) and selection type

After creating output structure go to LOGICAL VIEW Connect attribute tables to DATAFOUNDATION.

Activate and preview the data c) Calculated View We have two types of Calculated views 1) Graphical based 2) Script based 1) Graphical Based Here we can use any number of Tables and Views (Attribute, Analytic and Calculated) We can connect them by using Projection, Union, Join Right click on Package and select New Calculated View

Provide name, Description and type of calculated view (Graphical) Select required tables and views

a) Projection b) Join(Inner/outter{Left/Right})

c) Union

In output structure classify Attributes and Measures. And activate. 2) ScriptsBased Here we need to write script and provide custom Output Structure Right click on package create new calculated view Provide name, description and type (Script) Provide script like
/********* Begin Procedure Script ************/ BEGIN var_out = SELECT SHOP_FACTS.COLOR_CODE, SHOP_FACTS.QUANTITY_SOLD FROM EFASHION_TUTORIAL.SHOP_FACTS; END/********* End Procedure Script ************/

Click on Add Output Structure and provide name of col and type length

Classify Measure, attribute and activate

Вам также может понравиться