5 Replies Latest reply: May 31, 2013 5:30 AM by m.novaresio RSS

    Nested If to create a drop down selection

      Hi there, i have the following problem with a nested IF statement that won t work in a combined selection.

      the code is the following:

       

      =if (conto=62 and (sotco=30 or sotco=3 or sotco=27 or sotco=32 or sotco=15),62,

      if(conto=13 and (sotco=6 or sotco=1 or sotco=3), 13,

      if((conto=38 and sotco=36),38,

      if(conto=12 and (sotco=32 or sotco=60 or sotco=35),12,

      if(conto=10 and (sotco=30 or sotco=29 or sotco=26 or sotco=14 or sotco=27),10,

      if(conto=23 and (sotco=27 or sotco=19 or sotco=20 or sotco=21 or sotco=22 or sotco=28),23,

      if(conto=6 and (sotco=23 or sotco=22 or sotco=5 or sotco=24 or sotco=3 or sotco=18 or sotco=21 or sotco=28 or sotco=29 or sotco=11 or sotco=2 or sotco=27),6)))))))

       

      the expression is OK and it is used as a calculated field in a drop down selection object.

       

      The two criteria are Conto (parent) and Sotco. My goal is to display for each conto selection only certain sotco values... which works fine if i pick one choice only

      for instance is i pick uniquely conto 38 then i see only sotco 36.

       

      however the problem is ... if i select 38 and another let's say 13 i see all combinations possible insteda of the correct one... so i see 38-13, 38-6, 38-1, ....

       

      I tried a work around by creating a dummy field that would do the following (conto*10000)+sotco = conto0sotco and specifyng all the unique combinations... alas it does exaclty the same as above once i combine them it ignores the nesting and trasnforms everything in one big select all conto and all sotco specified...

       

      Can anybody tell if i am doing something wrong ?

       

      thanks!!