Page 1 of 1

IF statement in a rule

Posted: Thu Sep 10, 2015 9:12 am
by davidh
Hi all.

We have a rule in one of our cubes that converts our local currency data into AUD and AUDYE based on some exchange rates in another cube as shown below.

As you can probably tell this rule sets it to do it automatically for all of the elements in the “Company” dimension.

I would like to amend this rule so that it does it automatically for all elements in the "Company" dimension except for one called "PTLCON". I assume it just needs some sort of IF then or CASE type expression but I haven't been able to figure it out.

Any help would be appreciated.

The existing rule is

Skipcheck;
#translate local to AUD and AUDYE by multiplying by the exchange rate for each country. Currency stored in attribute of company
['AUD'] = n: ['Local'] * DB('Exchange Rates', !Year, 'Average Rate', db('}ElementAttributes_Company',!Company,'Currency'), !Version, !Month);
['AUDYE'] = n: ['Local'] * DB('Exchange Rates', !Year, 'Yearly Average Rate', db('}ElementAttributes_Company',!Company,'Currency'), !Version, !Month);

Feeders;

['local']=>['AUD'];
['local']=>['AUDYE'];

Regards

David

Re: IF statement in a rule

Posted: Thu Sep 10, 2015 9:34 am
by babytiger
I think you can archive this in various ways. Depending what you want to do with that PTLCON company.

Without knowing what you want to do with PTLCON, here is what I would recommend, you can add the following rule on top of your other 2 rules (and may be replace stet with whatever rule you want to apply.

Code: Select all

[{'AUD','AUDYE'},'Company':'PTLCON']= n: stet;

Re: IF statement in a rule

Posted: Fri Sep 11, 2015 1:14 am
by davidh
Thanks babytiger.

I don't need to do anything with PTLCON so the 'stet' function works a treat.

Thanks.