Quantcast
Channel: SCN : Unanswered Discussions - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 4343

Distinct count in HANA Views

$
0
0

Hi All,

I'm trying to create a simple report in Analysis for Office (or any other MDX tool) based on an HANA View which counts distinct MANDT of MARA's MATNR.

Table example (MARA):

 

MANDTMATNR
100       xxx
200yyy
100yyy

 

 

In order to do that, i created 2 test cases:

  1. Analytic view (from bottom node to semantics): Data Foundation Node  with only MARA, Output columns: "MANDT" and "MATNR". In Logical Join Node I defined a built-in "Distinct counter" on MANDT called "TEST_COUNTER".
  2. Calculation View  (from bottom node to semantics): Projection Node with MARA, Output Columns: "MANDT" and "MATNR", propagated to semantics. Aggregation Node, I defined a built in "Distinct counter" on MANDT Called "TEST_COUNTER".

I successfully activated both views and ran an Analysis Report on each one them, if I do not do anything, everything works fine: TEST_COUNTER equals 2.

Test Counter
2

 

My problem is that dragging "MATNR" in row area of analysis view in the "Total" row of both reports, I will find "3" as TEST_COUNTER, instead of "2" wich would have been the correct Total.

MATNR

Test Counter

xxx1
yyy2
Total

3

 

please notice that this is a simplified scenario - i.e. my real table has more than 20 fields....

Any suggestion on how to achieve the distinct count?


Viewing all articles
Browse latest Browse all 4343

Trending Articles



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