Hi,
you have to use a nested IF
A. The first solution - what I already mentioned could be to join the six values in a first equation
eqJoin: {join(that.LSM.NAOK)}
Then - in a second equation you preset. Now you only use the several strings, like
{LC=if(eqJoin=="222222",3,if(eqJoin=="222221",2,if(eqJoin=="222212",3,,if(eqJoin=="222211",2,...,if(eqJoin=="111111",1,0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))})))))))}
The next solutions are based on my understanding of the routing scheme, better you'd provided the whole table with all 64 values)
B. The second solution
Now if you investigate the routing a bit, you will see that there are only 10 relevant routes.
I changed the codes from 1/2 to 0/1
X = value irrelevant
Now I see these strings as binary numbers (X->0) and get
000XXX = 0 -> 1
001XXX = 8 -> 2
1XX00X = 32 -> 1
1XX01X = 34 -> 2
1XX1X0 = 36 -> 2
1XX1X1 = 37 -> 3
01X00X = 16 -> 1
01X01X = 18 -> 2
01X1X0 = 20 -> 2
01X1X1 = 21 -> 3
This willl be a bit more work at the beginning to calculate the decimal numbers out of the binary numbers, but you only have 10 nested IFs instead of 64,
{LC=if(newValue==0,1,if(newValue==8,2,if(newValue==32,1,if(newValue==34,2,if(newValue==36,2,if(newValue==37,3,if(newValue==16,1,if(newValue==18,2,if(newValue==20,2,if(newValue==21,3,0))))))))))}
C. And the third:
You see the structure of the numbers above
If it starts with
00: the third character defines the group (value + 1)
1: if the fourth character is 0, the fifth defines the group (value + 1)
if the fourth character is 1, the sixth defines the group (value + 2)
01: if the fourth character is 0, the fifth defines the group (value + 1)
if the fourth character is 1, the sixth defines the group (value + 2)
This could lead to an equation like
{LC=if(substr(eqJoin,0,2)=="00", sum(substr(eqJoin,2,1),1),if(substr(eqJoin,0,1)=="1", if(substr(eqJoin,3,1)=="0", sum(substr(eqJoin,4,1),1), sum(substr(eqJoin,5,1),2) ),if(substr(eqJoin,0,2)=="01", if(substr(eqJoin,3,1)=="0", sum(substr(eqJoin,4,1),1), sum(substr(eqJoin,5,1),2) ),0)))}
Well, the first is straightforward, though a bit lengthy, the second is elegant, but requires some additional calculations, the third is in my opinion the best (though to be checked)
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless