Page 1 of 1

Rule error

Posted: Fri Aug 19, 2011 10:24 am
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.

Re: Rule error

Posted: Fri Aug 19, 2011 10:31 am
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.

Re: Rule error

Posted: Fri Aug 19, 2011 10:39 am
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 ?

Re: Rule error

Posted: Fri Aug 19, 2011 10:49 am
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?

Re: Rule error

Posted: Fri Aug 19, 2011 10:52 am
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'];

Re: Rule error

Posted: Fri Aug 19, 2011 10:54 am
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 );

Re: Rule error

Posted: Fri Aug 19, 2011 11:51 am
by jstrygner
Is it possible you have Feeder instead of Feeders causing the problem?

Re: Rule error

Posted: Fri Aug 19, 2011 1:55 pm
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

Re: Rule error

Posted: Mon Aug 22, 2011 8:18 am
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.