Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
dmitri_marinin
Explorer

Problem description: when you try to replace node in graphical calculation view, SAP HANA Studio function “Replace with” do not offer all possible options. If you delete bottom node of calculation view from top node, all reference columns will be also removed from all connected top nodes.


First of all you should use development perspective. If you use Modeler perspective you can easily migrate your views to development perspective. If you try to apply “Check Out and Import Projects” operation (Development perspective->Repositories) on package created in Modeler

you will get an error “No projects are found to import”:

To fix it you should open Development perspective->Repositories, add .project file (in attachment) to your package, fix package name inside .project file and

activate .project file:


<?xml version="1.0" encoding="UTF-8"?>

<projectDescription>

  <name>A00_MOD_PERSP_PROJ</name>


Package cannot be structural.  You can unmark this option using edit package.


After these actions you can Check Out and Import Project and use Project explorer for development:

Let’s consider the next graphical calculation view that includes projections and join:

But what if now you need to aggregate Projection_2 data and include result in Join_1:

You are not able to use “Replace with” functionality:


But you can open Calculation view with text editor:

Find Join_1 metadata:

    <calculationView xsi:type="Calculation:JoinView" id="Join_1">

      <viewAttributes>

        <viewAttribute id="id"/>

        <viewAttribute id="name_firstName"/>

        <viewAttribute id="name_middleName"/>

        <viewAttribute id="name_lastName"/>

        <viewAttribute id="orgUnit"/>

        <viewAttribute id="address_id"/>

        <viewAttribute id="street"/>

        <viewAttribute id="city"/>

      </viewAttributes>

      <calculatedViewAttributes/>

      <input node="#Projection_1">

        <mapping xsi:type="Calculation:AttributeMapping" target="id" source="id"/>

        <mapping xsi:type="Calculation:AttributeMapping" target="name_firstName" source="name_firstName"/>

        <mapping xsi:type="Calculation:AttributeMapping" target="name_middleName" source="name_middleName"/>

        <mapping xsi:type="Calculation:AttributeMapping" target="name_lastName" source="name_lastName"/>

        <mapping xsi:type="Calculation:AttributeMapping" target="orgUnit" source="orgUnit"/>

        <mapping xsi:type="Calculation:AttributeMapping" target="address_id" source="address_id"/>

      </input>

      <input node="#Projection_2">

        <mapping xsi:type="Calculation:AttributeMapping" target="street" source="street"/>

        <mapping xsi:type="Calculation:AttributeMapping" target="city" source="city"/>

        <mapping xsi:type="Calculation:AttributeMapping" target="address_id" source="id"/>

      </input>

      <joinAttribute name="address_id"/>


Replace “Projection_2” on “Aggregation_1”

      <input node="#Aggregation_1">

        <mapping xsi:type="Calculation:AttributeMapping" target="street" source="street"/>

        <mapping xsi:type="Calculation:AttributeMapping" target="city" source="city"/>

        <mapping xsi:type="Calculation:AttributeMapping" target="address_id" source="id"/>

        </input>


And activate the view (you can use “Reset to active version” if something goes wrong). Then open the view with SAP HANA View editor:

Another very useful approach concerning new view development – add Technical Union before final Aggregation:

So you can easily add another final node (or nodes) in place of Join_1 and then remove Join_1 without losing any metadata.

8 Comments
Labels in this area