4 Replies Latest reply: Mar 10, 2015 7:17 AM by venkat nomula

# Long expression with multiple ifs

Hello!

I am trying to make my application calculate values but having an issue with getting the proper numbers(and it gets even worse when I select the calculated dimension).

I am trying to utilize data from several tables like in the example below:

 Table1 Field0(PK) Field1 Field2 Field4 Field5

 Table2 Field0(PK) Field3

 Table3 Field0(PK) Field4 Field5

I need to have a formula similar to this:

if(Field1=AAA and not(Match(Field2,'A',B','D')) and Field3<>5 and (Field5>Field5*0,32) ,’Right’, ‘Wrong’)

Having multiple nested ifs like

if(Field1=AAA, if(not(Match(Field2,'A',B','D')) , if(Field3<>5, if(Field5>Field5*0,32,’Right’, ‘Wrong’))))

doesn't solve the problem and gives different result; and it is wrong.

Currently I have this in my list box expressions but I suspect this is not the best way to do it. And later I am going to have more calculations like this so perhaps there should be netter formulas and better ways to organize the calculation process. Could anyone give any hints?

• ###### Re: Long expression with multiple ifs

We can do something in the script itself. By looking at the tables i thing you must be getting a synthetic keys between Table1 and Table3 ?

• ###### Re: Long expression with multiple ifs

Hi,

Concatenate all the tables and write same expression in script as new field so that you can use newly created field in UI directly.

• ###### Re: Long expression with multiple ifs

All my tables(I have 7 now) have same field(only one) which automatically connects them. Do I concatenate all of them?