on 03-27-2012 5:01 AM
Hello,
There is an option to create counter type measures with calc views that perform a count distinct of e.g materials, customer etc. However, there is no such option with an analytic view. I would hate to create a calc view just to use the counter feature of calc views. Is there an opportunity to create a calculated measure in an analytic view and write the SQL to do a count distinct in the expression editor?
Thanks,
Hello,
There are two options,
Option 1:
You may add the column from which you need to get the distinct count, as a Measure, with an aggregation type of 'COUNT'. This can be set in the Semantic Node.
In this option, please switch the flag "Allow Relational Optimization" to False, if you are getting inconsistent counts.
Option 2:
Add a numeric calculated column with a constant value of '1' and aggregate it with SUM in the Semantic node.
Let me know if that works for you.
Regards
Ajay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wanted to count # of VBAP records and first did that in the calculation view (created a counter on attribute VBELN with POSNR). This worked fine but response time of my view having 15 mil VBAP records went up to about 18 seconds.
Then I tried on the analytical view on VBAP: created a calculated measure (SUM) with static value 1 doing a calculate before aggregation. Same result but response time was ~3 seconds.
This test was on SP4.
Haven't tried again on SP5.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BTW, one point. With the very basic nature of columnar database implemented in HANA, the distinct count of material / articles / documents is quite easy from database perspective. This is whole reason for using the columnar database as the processing will happen on the column itself which is stored in most efficient manner in the DB.
Alternatively you can check the distinct values in the columns using the distinct option on the table in HANA studio.
For reporting purpose it should not impact the performance if you select the distinct value from the analytic view.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Counters has been designed only for Calc Views and not for Analytic Views.And creating Calc Measure with SQL script is not possible.
Rgds,Murali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh,
The use of Calc Views are to reduce the data retrieval time by using the CE functions and hence improving the performance.Whenever you want to implement some complex business logic which cant be addressed with Analytic Views,you will go for Calc Views.There is a very good comparison table about all these things in SDN.So when you use Calc Views,it will improve the performance.
And using Count will not affect the performance as we retrieve only limited set of values here.Ideally Count should have been included in Analytic View itself rather than putting it into Calc Views.But that'show they designed it
Rgds,Murali
Hello,
I don't think so, that you can write SQL in the calculated measure.
Regards,Neha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.