on ‎2013 Jul 15 12:23 PM
Hello,
I was trying to create a create a calculation view with aggregated data, for example Car dealers and the total number of cars sold in a month.
So I need to group by dealer and get the count of cars that are sold.
I want to create a graphical calculation view. When I use aggregation node I can see only sum, max & min.
How can I get count or avg function?
Expecting a response.
Much Thanks,
Indu
Request clarification before answering.
Hi Indu,
You can use the "Counter" in Calc view. As per the modeling guide for HANA:
Counters add a new measure to the calculation view definition to count the recurrence of an attribute. For example, to count how many times product appears.
Create counters to obtain the number of distinct values of an attribute (optional)
a) Select the default aggregation node.
b) In the Output pane, right-click Calculated Columns.
c) From the context menu, choose New Counter. Enter a name and description (label).
d) To hide the counter during data preview, select the Hidden checkbox.
e) To add attributes in the Counters panel, choose Add and choose OK.
Remember
You can only create counters on the default aggregation node.
Please refer to the documentation for further details.
This can be used in your case to calculate the average (sum(KF) / count(KF))
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 Ravi,
As you mentioned, why do we need to use aggregated node while using counters as counters can be used without aggregated node.
Secondly, if I use a aggregated node and then while creating a counter what shud be selected in the attributes, Measures and the attributes within the counter?
Hope you would have understood.
Hi Indu,
As I mentioned, explicit aggregate node is not required. If your Calc view is being used for Multi Dimensional reporting, by default the behavior of Calc view is to AGGREGATE the data.
Secondly the counter works something like Exception aggregation in BW BEx queries. Here you need to select the counter by a given attribute. If you select dealer, then it will be COUNT(Dealers). If you want to count the number of complaints then you need to select the complaint no in the counter. But prior to that you need to select the complaint no in the output.
Then you can fire a query against the Calc view with DEALER and TOTALCOMPLAINTS in the select statement.
Regards,
Ravi
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.