Tuesday, February 14, 2012

Calculating last non empty of measures that are not included in a month

Hi!

I have two tables.

One is measures like this

Product Measure Date

Prod A 10 12, Jan 2006

Prod A 15 20, Jan 2006

Prod A 11 5, Mar 2006

The other is time dimension

When I create a cube, I would like to see by months last value of measure.

So in Feb I should get 15.

My question is - should I create a query and run it on server to

1. Find which months are not icluded in measuers

2. Then find last value for each product

3. Write into new table measures, where February will have last non empty value from January?

Or can I do it cube in some way?

The best way to solve this in AS2005 is to define measure aggregation function as LastNonEmpty - it will do exactly what you need.

No comments:

Post a Comment