Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

Merging 2 Analytic Views on Calculation View

$
0
0

I'm a little stuck on something which looks simple but can't model it correctly.

 

 

I have 2 analytic views that I need to merge where all the records from both views show, like a Union.

 

For reference, I'm getting 7 records in table AFRU and 5 in AFVV, I want to merge these records getting relevant corresponding data.

 

 

Here is an example.

 

 

My 2 Analytic Views

 

 

Analytic View 1

Order       CompanyCode    Activity    Location     Quantity     Price

10                 100                    10               CHI               4              10

10                 100                    10               CHI               5              13

10                 100                    20               NYC             4               22

10                 100                    30               SFO             1                5

10                 100                    30               SFO             5              33

 

 

 

 

Analytic View 2

Order       CompanyCode    Activity        CostCenter        Quantity     Price

10                 100                    40               FSDF                      4               10

10                 100                    50               FSFD5                   13               44

10                 100                    60               GGG4                     22               66

10                 100                    70               FFF                         1                5

10                 100                    70               FFF                          5              33

 

 

I want to merge and want all the records from both views, the non-measure fileds Location and Cost Center should  get filled also because logic is synchronized.

 

 

Output

 

Order       CompanyCode    Activity    Location           CostCenter       Quantity     Price

10                 100                    10               CHI                  DFS                     4              10

10                 100                    10               CHI                  FDES                   5              13

10                 100                    20               NYC                SSA                     4               22

10                 100                    30               SFO                 RRR                    1                5

10                 100                    30               SFO                 RRR                    5               33

10                 100                    40               AFR                 FSDF                  4               10

10                 100                    50               CAL                  FSFD5                5              13

10                 100                    60               NOWt               GGG4                 4               22

10                 100                    70               FTD                   FFF                   1                5

10                 100                    70               FTD                   FFF                   5               33

 

 

How can I merge the 2 Analytic Views? What join type? What cardinality? What Node? What table should be on left and what on right?

 

Note: I can't use a Union node right? (because not all non-measure fields match (Location doesn't exist in analytic 2 & Cost Center doesn't exist in analytic 1) or maybe I'm wrong in thinking that.


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>