# Nested IF Statements in Rules Slow Server Down

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

• # Nested IF Statements in Rules Slow Server Down

Hello,

I am experimenting with using 3 nested IF statement in RULES, however the response from the Jedox OLAP server is extremely slow, even in the case of a small example with one cube with 2 dimensions (3 x 3 elements).

For example the rule that I am trying is:

['Income (Default)'] = B:IF(['Income (USD)'] > 0,['Income (USD)'],IF(['Income (EUR)'] > 0,['Income (EUR)'],IF(['Income (COP)'] > 0,['Income (COP)'],0)))

It takes several minutes for a simple report to calculate, even though this is the only rule in the cube. The report looks like:

[IMG:http://s17.postimg.org/yzc588qen/Nested_IF.png]

My question is, therefore, if I am doing anything wrong, or if there is any other way to do IF THEN ELSE statements in Jedox that is more agile.

Thanks to the community for any help.

Mauricio Roman
• Hi Mauricio,

I don't think that on such small model the calculation time can be measurable.
Anyway this is typical scenario causing performance problems. It has several solutions

1. use markers. Ideal if the ['Income (USD)'], ['Income (EUR)'], ['Income (COP)'] are base values (not consolidations or rule caclulated)
['Income (Default)'] = B:IF(['Income (USD)'] > 0,[['Income (USD)']],IF(['Income (EUR)'] > 0,[['Income (EUR)']],IF(['Income (COP)'] > 0,[['Income (COP)']],0)))
cons: higher memory consumtpion, slower startup,rule editing and writebacks. Rule sources are also rules calculated these rules have use markers as well.

2. remove IF. if you are sure that only one of cells ['Income (USD)'], ['Income (EUR)'], ['Income (COP)'] can contain value
['Income (Default)'] = B: ['Income (USD)'] + ['Income (EUR)'] + ['Income (COP)']
or in combination with option 1)
['Income (Default)'] = B: [['Income (USD)']] + [['Income (EUR)']] + [['Income (COP)']]

regards

Jiri