I'm trying to get this equation to take the pattern count of a linear pattern in assembly in SW 2013 and then set another dimension equal to a constant based on the pattern count. I keep getting the dreaded "Syntax of this equation is incorrect error"

= iif ( "D1@LocalLPattern1" = 1 , 0 , iif ( "D1@LocalLPattern1" = 2 , 0.125 , iif ( "D1@LocalLPattern1" = 3 , 0.25 , iif ( "D1@LocalLPattern1" = 4 , 0.375 ) ) ) )

As an excel formula I have this below as the string and it works fine in excel. The B12 is the Pattern Count Value:

=IF(B12=1,0,IF(B12=2,0.125,IF(B12=3,0.25,IF(B12=4,0.375))))

If someone could give me a direction on how to get this equation to work I would appreciate it.

See below in

red.= iif ( "D1@LocalLPattern1" = 1 , 0 , iif ( "D1@LocalLPattern1" = 2 , 0.125 , iif ( "D1@LocalLPattern1" = 3 , 0.25 , iif ( "D1@LocalLPattern1" = 4 , 0.375

, .5) ) ) )