Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

How to create custom agreggations?

$
0
0

Hi. I am new to OLAP cubes and I am trying to accomplish something that is likely not so difficult but I am lost at the moment. To make a long story short, I developped an application that used a SQL view to retrieve data and then used a 3rd party component to make a pivot grid. It was working fine at first but now that there is much more data, performance is not good enough. That 3rd party component recommends to use an OLAP cube instead of processing all data from a table/view to increase performance for a large number of rows.

So I installed Business Intelligence Developement Studio and made a cube based on this view. I used the appropriate measures and I am in the process of adding the required dimensions. So far it works really good, the performance is much better. Unfortunately I have a problem that I am not sure how to solve. Previously I was doing some "weighted average" (more on that later) for some fields, it was possible because I had all the rows. Now with the cube obviously I cannot do that.

I am trying to do an agregate field but I am not sure how I can do this. Should it be a calculated field? I am looking in BIDS and I am not sure where I should go to accomplish that.

Basically I have rows that represent a presentation (1 row = 1 presentation). In that row I have a field Available that represents the number of available seats for the presentation and another field Reserved that represents the seat reserved. I am trying to get the "weighted average" to know the % of seats occupied. I cannot simply do an average because some presentations have more available seats and some have less.

For example:

Show 1: 5 reserved out of 10 seats

Show 2: 16 reserved out of 20 seats

Show 3: 20 reserved out of 25 seats

The agreggation I want is: (5 + 16 + 20) / (10 + 20 + 25)

My application can easily do an average but it would be (5/10 + 16/20 + 20/25) / 3, which is not what I want.

Any help would be appreciated!

Thanks


Viewing all articles
Browse latest Browse all 2472

Trending Articles



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