Rule error

Post Reply
User avatar
LeeTaylor1979
Posts: 63
Joined: Mon Aug 25, 2008 12:53 pm
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: 2010

Rule error

Post by LeeTaylor1979 »

Hi All,

Being a global Company we load data into cube in various different currencies.

I then like to use exchage rates to view totals in a base currency, in this case I want to convert Mexican Pesos to US dollar and add to the existing US Dollar total.

Done this 100 times in other cubes but will not let me save the rules as apparently I am "missing left square Bracket"

This is my rule.

['MABS US', 'Base Currency'] = N: [ 'USD' ]
+ [ 'MXN' ] \ db( 'ExchangeRates', 'MXN', !Version, !Period );

I have very similar rules in other cubes that work fine but not this one.

Can anyone spot any errors please, feel a bit silly as this is such a simply rule but got to the stage where I think I have tried everything.

Thanks in advance.
Christopher Kernahan
Community Contributor
Posts: 147
Joined: Mon Nov 29, 2010 6:30 pm
OLAP Product: Cognos TM1
Version: 10.1
Excel Version: Office 2010

Re: Rule error

Post by Christopher Kernahan »

Hi Lee,

Sometimes this can be generated further up the rule file where there is missing syntax. Also, try putting your [] selections on the RHS in DB formulas.
User avatar
LeeTaylor1979
Posts: 63
Joined: Mon Aug 25, 2008 12:53 pm
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: 2010

Re: Rule error

Post by LeeTaylor1979 »

Hi Christopher,

Thanks for the reply, This is the top of the rules and then I have a feeder underneath, very simple cube.

Im winding down for the weekend and being a bit thick :oops: when you say put the [] on the RHS of db formulas where exactly do you mean ?
User avatar
qml
MVP
Posts: 1094
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: Rule error

Post by qml »

He meant you should try to use the DB() notation instead of the [] notation in the whole rule - that is, in all the 3 parts of the calculation on the right hand side.
Also, if the rule script is so short, can you paste the whole thing here?
Kamil Arendt
User avatar
LeeTaylor1979
Posts: 63
Joined: Mon Aug 25, 2008 12:53 pm
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: 2010

Re: Rule error

Post by LeeTaylor1979 »

The whole script.

SKIPCHECK;

['MABS US', 'Base Currency'] = N: [ 'USD' ]
+ [ 'MXN' ] \ db( 'ExchangeRates', 'MXN', !Version, !Period );


Feeder;


['USD']=>['Base Currency'];

['MXN']=>['Base Currency'];
Christopher Kernahan
Community Contributor
Posts: 147
Joined: Mon Nov 29, 2010 6:30 pm
OLAP Product: Cognos TM1
Version: 10.1
Excel Version: Office 2010

Re: Rule error

Post by Christopher Kernahan »

As qml says, it would be

DB('Cube', 'USD', !all other dimensions) + DB('Cube', 'MXN', !all other dimensions) \ DB( 'ExchangeRates', 'MXN', !Version, !Period );
jstrygner
MVP
Posts: 195
Joined: Wed Jul 22, 2009 10:35 pm
OLAP Product: TM1
Version: 9.5.2 FP3
Excel Version: 2010

Re: Rule error

Post by jstrygner »

Is it possible you have Feeder instead of Feeders causing the problem?
User avatar
mattgoff
MVP
Posts: 516
Joined: Fri May 16, 2008 1:37 pm
OLAP Product: TM1
Version: 10.2.2.6
Excel Version: O365
Location: Florida, USA

Re: Rule error

Post by mattgoff »

Try deleting the rule and recreating, typing it all by hand instead of copy/paste. I've seen this before when unicode accidentally gets pasted (or typed if a non US keyboard) in.

Matt
Please read and follow the Request for Assistance Guidelines. It helps us answer your question and saves everyone a lot of time.
User avatar
LeeTaylor1979
Posts: 63
Joined: Mon Aug 25, 2008 12:53 pm
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: 2010

Re: Rule error

Post by LeeTaylor1979 »

Thank you all for your replies,

jstrygner you have hit the nail on the head.

Very embarrassed :oops: but I spent so much time looking at the Left bracket missing message I failed to spot that I was missing an s off Feeders.

This now saves and works.

Apologies but thanks a lot for the help.
Post Reply