DB Rule help

Post Reply
User avatar
ADW
Posts: 32
Joined: Tue Jun 14, 2011 11:10 am
OLAP Product: Cognos Express
Version: 9.5
Excel Version: 2010
Location: Cheshire, England

DB Rule help

Post by ADW »

I have a source cube:

Code: Select all

DB('Volume',!Version,!Time_Month,!New Used,!Market,!Model,!Volume Measures)
And a target cube:

Code: Select all

DB('Contribution',!Version,!Vs. Version,!Variance Type,!Time_Month,!New Used,!Company Code,!Market,!Model Year,!Model,!Currency,!Contribution Measures)
I want to pull the Wholesales value (Volume Measure:TOTAL WHOLESALES) from the source cube into the target cube (Contribution Measure:Wholesales).

This works:

Code: Select all

['Wholesales', 'None', 'Version':'Forecast', 'Total Variance', 'LC', '0750' '12MY'] = N:	DB('Volume',!Version,!Time_Month,!New Used,!Market,!Model,'TOTAL WHOLESALES') ;
However, I want to be more dynamic in my selection criteria. So I thought I could do a DB against the target cube and just fill the information that the source cube does not have dimensions for. As such:

Code: Select all

['Wholesales'] = N: DB('Volume',!Version, 'None', 'Total Variance', !Time_Month, !New Used, '0750', !Market, '12MY', !Model, 'LC', 'TOTAL WHOLESALES') ;
Version = Forecast
Vs. Version = None
Variance Type = Total Variance
Time_Month = Bang
New Used = Bang
Company Code = 0750
Market = Bang
Model Year = 12MY
Model = Bang
Currency = LC

Have I made up in my head that you can do this? It would be really useful as I don't want to fix the model year to 12MY, or write a rule for each year, that just seems silly.
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: DB Rule help

Post by David Usherwood »

Writing a rule to pull data from a small cube to a larger cube isn't that difficult - just leave out references to the dims in the target but not in the source as per your first example. If you want to be dynamic, create a mask cube of 1s and 0s and multiply that by the data from the source.

But...
You haven't mentioned feeders. Feeders from a small cube to a larger cube are normally a Bad.Idea. What are you doing with the Wholesales value? If you are allocating it using data you have in your target cube, use that data to feed your output and leave the Wholesales unfed. But you haven't said what you are doing with this data.
Post Reply