# Rule for two-way calculations

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

• # Rule for two-way calculations

Hi.

I have a problem. I don't know how to make a rule(s) for this situation:

I have the cube 'Sales' with 3 dimensions in it:

1. Products
2. Customer
3. SalesMeasure

The problem is in 3rd dimension.

It consist of 3 elements:
-units
-price
-amount

straight direction formula is 'amount'='unts'*'price'
backward direction formula is 'units'='amount'/'price'

So I'm holding only 'price' and want to play "what-if" with the rest elements in any direction i want.

When i write this two rules on 'Sales' cube i've got rubbish.

I've done this trick with Cognos EP

How could i do this in Palo 3.2+

Thx
• # RE: Rule for two-way calculations

Anyone can help?
• # RE: Rule for two-way calculations

Hi,
at least in 3.1 CE what you say it's not possible, you would cause a kind of "circular reference" between Units and Price.
I've read that other products can perform this, but in Palo this is not allowed directly (maybe someone can suggest a workaround),
regards,
RQ
• Yes, this this is possible with Supervision Server. SVS allows you to hold the old value, new value and do any range of circular calculations on your number set.

It also allows you to perform a "2 way" calculation as described in your example.
• # RE: Rule for two-way calculations

Hi nikita,

One work around would be to create two additional elements in the SalesMeasure dimension:
- calculated unit
- calculated amount

If you had rules similar to the following this will give you some level of what-if analysis.

### Source Code

1. ['calculated amount'] = N:['unit'] * ['price']
2. ['calculated unit'] = N:['amount'] / ['price']
Hope this helps.

Rod

The post was edited 1 time, last by Rod ().