# Jedox 7 Rules bug

Hi community!

I'm trying to upgrade a proyect to v7. Our proyect have some cubes with bussines rules.
Several rules are composed by "IF" logical conditions, like this example:

['Delivering savings'] = B:IF((['Total savings in percent'] - ['Company Savings']) < 0,0,['Total savings in percent'] - ['Company Savings']).

This kind of rules are bugged. When rule are active, the OLAP server return a time out.

Have anyone experience to migrate a v6 proyect to v7 with this type of rules?

Thanks for all

Jorge López Hernández

+34 912 868 220– jlopezhernandez@quental.com
After several proofs we concluded that, just occurs with greater, lower greater-equal and lower equal operators.
Rules with equal and not equal works fine, that its an example:

['Total savings'] = B:IF(['Historical price'] != 0,['Historical price'] - ['Mark up price'],['Reference Price'] - ['Mark up price'])

Any ideas?

Jorge López Hernández

+34 912 868 220– jlopezhernandez@quental.com
Not related directly to this, but we also faced issue with rules in v7.0 .
Our MOLAP crashed when following type of rule is used:
[‘Account1’,’Jan’] = [‘Account2’] – [‘Account2’,’BegBalance’]
i.e. in first part of right hand side, there is no Month defined

Jedox provided us with a patch for this and then it worked fine.. May be you can raise a support ticket for your issue as well ..

Also, did u try to patch with 7.1 , it has solved many of rule relates issues.
I have an answer from support

The new "if conditionals" syntax is imputing a null instead of a 0, but its not possible write the rule like this
['Measures':'Units Market'] = B:IF([['Measures':'Units']] != 0,1,null)

So that the rule does not crash the OLAP engine its necessary put a space between the last coma and null value, like this

['Measures':'Units Market'] = B:IF([['Measures':'Units']] != 0,1, null)

Jorge López Hernández

+34 912 868 220– jlopezhernandez@quental.com

Post was edited 2 times, last by “JLop” ().

Hi

OLAP 7 distinguishes between 0 and null. Its is documented breaking change.
Processing of 0 costs much more memory and cpu whereas null is almost for free.

so
['Delivering savings'] = B:IF((['Total savings in percent'] - ['Company Savings']) < null,null,['Total savings in percent'] - ['Company Savings']).

Should do the job.
I's also recommend to use comparison operators that do not include equality check ( >, <, != ) than others (>=, <=, ==). It is faster in new engine that was built to eliminate need of markers.

Jiri