COGNOiSe.com - The IBM Cognos Community

Planning & Consolidation => TM1 => Topic started by: satay2hot on 08 Sep 2016 08:17:06 AM

Title: Need help on referencing from another cube
Post by: satay2hot on 08 Sep 2016 08:17:06 AM

I am relatively new in TM1 and wondering any kind soul would be able to help.

I want to target cube to refer to currency_table for the rate

Reference table is currency_table has currency like USD, JPY.. and has the rate
The target cube has a picklist field called CUR (which has USD, JPY etc). If user choose USD. it will look for the rate from the currency table and insert into the target cube "rate" field

I cannot get rules right I tried the following but it was wrong
[Rate]=N:if ([Cur]  =  DB(  currency_table, [currency] ),DB(  [currency_table,[rate],0)  )

Thanks for your attention

Vincent

Title: Re: Need help on referencing from another cube
Post by: dusherwo on 09 Sep 2016 04:01:43 AM
You need to use the ! syntax as per the manual for matching elements across cubes.
Also, you don't need to test lookups - failures will silently return nothing.
So I'd suggest your code should simplify to something on the lines of
Quote
['Rate']=N:DB('currency_cube',
  DB('This Cube',!Year,!Month,!Version,'Rate')
  );

Title: Re: Need help on referencing from another cube
Post by: satay2hot on 09 Sep 2016 03:12:18 PM
Dusherwo
I got it working thanks to you.

Cheers
Vincent