Skip to Content

Create a Cube Calculation View (XS Advanced)

Create a graphical calculation view with a cube data type.
You will learn
  • How to create a calculation view with a Cube data type
  • Use a star join to combine data from a dimension calculation view and a table
  • Perform currency conversion
jung-thomasThomas JungJanuary 5, 2021
Created by
Lsubatin
August 10, 2018
Contributors
jung-thomas
Lsubatin

Prerequisites

  • Step 1

    Create a new calculation view in your models folder.

    Create calculation view

    Call it PURCHASE_ORDERS, choose CUBE as a data category and mark the flag for With Star Join

    Call it PO
  • Step 2

    Drag and drop a join node and add click on the + sign to add the data sources

    New Join node

    Type PO and choose both PO.Header and PO.Item and click Finish.

    Call it PO

    Create a inner join using PURCHASEORDERID and set the cardinality as 1..n

    Call it PO

    In the mapping tab, add the following columns to the output: PURCHASEORDERID, HISTORY.CHANGEDAT, PRODUCT.PRODUCTID, CURRENCY and GROSSAMOUNT.

    Mapping

    Finally, rename the node to PO.

  • Step 3

    Connect the output of the join to the Star Join. Use the + sign to search and select PRODUCTS.

    Create star join

    Join the PRODUCTID and PRODUCT.PRODUCTID as an inner join.

    Mapping
  • Step 4

    In the Parameters tab of the Star Join Node, create an input parameter named IP_O_TARGET_CURRENCY.

    Mapping

    Configure it as NVARCHAR, length 3 with a Semantic type of Currency.
    Flag it as mandatory and set a default value of USD.

    Mapping
  • Step 5

    Go into the mapping tab and double click on the PO parent node to add all of the fields to the output. Add the GROSSAMOUNT a second time.

    Mapping

    Change the name of the duplicate column to OriginalGrossAmount.

    Mapping

    Click the semantics node. Change the Type of the PURCHASEORDERID to be an Attribute.

    Attribute

    Assign semantics for GROSSAMOUNT.

    Assign Semantics

    Choose Amount with Currency Code and configure as follows:

    • Display Currency: column, choose GROSSAMOUNT_CURRENCY
    • Check the Conversion and Decimal shift boxes
    Mapping

    Click on the definition tab and use the following configuration

    Mapping

    Save the view.

  • Step 6

    Build the db module and return to the database explorer

    Mapping

    Navigate to the column view, right-click on it and select Open Data.

    Final view

    What happens when you execute the view?

Back to top