18 Replies Latest reply: Nov 7, 2017 9:08 AM by Sunny Talwar RSS

    Nested If with getfieldselections not working

    Eddy Van Eynde

      Hi,

       

      I'm trying to use getfieldselections in an expression,  to get the user's selection of the company code.

      Because I have multiple possibilities, I use a nested if. But it works for only for one nested if, when I add another 'if' I get a error in the expression.  is there a restriction in use, because separate the syntax is working.

       

      =if(GetFieldSelections([Company Code])= ' ',Sum({$<[Customer Code]=E({1<[NoFilter]={'Intercompany-4'}>})>}Quantity)

      ,if(GetFieldSelections([Company Code],'+',2)='BE04','US12',Sum({$<[Customer Code]=E({1<[Filter BE04/US12]={'Intercompany-4'}>})>}Quantity))

      ,if(GetFieldSelections([Company Code],'+',2)='BE04','US29',Sum({$<[Customer Code]=E({1<[Filter BE04/US29]={'Intercompany-4'}>})>}Quantity))

      ,if(GetFieldSelections([Company Code],'+',2)='US12','US29',Sum({$<[Customer Code]=E({1<[Filter US12/US29]={'Intercompany-4'}>})>}Quantity)))

       

      or

       

      =if(GetFieldSelections([Company Code],',',2)='BE04','US12',Sum({$<[Filter BE04/US12]=-{'Intercompany-4'}>}Quantity)

      ,if(GetFieldSelections([Company Code],',',2)='BE04','US29',Sum({$<[Filter BE04/US29]=-{'Intercompany-4'}>}Quantity))

       

       

      With both I get an error, can anyone say what the problem is

      Or is it better to use pick match ..;  but how is the syntax to get the same result

       

      Br