cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Aggregate data in Calculation View

Former Member
0 Likes
4,609

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

View Entire Topic
ranjit_alapati
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Indu,

It is not possible to calculate average using the aggregate function. you can do it by defining the average as a calculated column.

For count you can use the counter option, which allows to count distinct rows based on certain columns.

Best Regards,
Ranjit

Former Member
0 Likes

Thanks Ranjit for the response, But wat I don't understand is while creating the counters do we need to add a aggregation node?

Or just create the dealer attribute and create a counter for the total number of cars sold?

When I tried without the aggregation node, I don't see any data in the data preview.

I have added dealer & cars sold in the output columns & created a counter with cars sold.

But not working!

Ravi_Channe
Active Contributor
0 Likes

Hi Indu,

Which revision of HANA are you currently using. In SPS06 rev 60, the aggregation node is automatically added, but prior to rev 60, it is not mandatory to add EXPLICIT aggregation node.

You can check the output node and create the counter there.

Secondly when you mentioned, that the data preview did not show any data, was there any error. Can you please check the SQL generated (View log, check the SQL generated).

Please add some screenshots to understand the model you created and the SQL statement.

Regards,

Ravi

Former Member
0 Likes

Ravi,

I am using SPS04. I have attached the screen shots of the model.

I have created Dealer as a output attribute.  Now I want the total number of complaints for a dealer.

So while trying to create a counter for total number of complaints I can see only dealer as the attribute in the create counter view.

Thanks,

Indu