2 Replies Latest reply: May 15, 2014 9:54 AM by Grant Perkins RSS

    A nested IF statement

    ron cousino

      Is there a way to use a nested IF function statement to translate data?  I have a field in my database with values that mean a certain language. (i.e. 1=English, 2=Spanish, 3=Eubonics).  Using a calculated field IF function I can return one example:  IF(Language=1,"English","0") but I want one calculated field that will give me all results for summarization.  I can't seem to get the nesting built appropriately or am I going in the wrong direction.  :confused:

        • A nested IF statement
          Nick Osdale-Popa

          What version of Monarch are you using?

          V6 has a lookup formula that should suit your needs quite nice.

           

          Otherwise, try something like these:

          [font="courier"]IF(Language=1,"English", If(Language=2,"Spanish","Eubonics"))[/font][/quote]I'm not sure how many nests Monarch allows, to circumvent the limit you can do this:

          [font="courier"]IF(Language=1,"English","")If(Language=2,"Spanish","")If(Language=3,"Eubonics","")[/font][/quote]

           

          [size="1"][ February 05, 2003, 01:07 PM: Message edited by: Nick Osdale-Popa ][/size]

          • A nested IF statement
            Grant Perkins

            Nick's suggestions are in line with nesting that I have used in the past. I have run nests up to about 10 levels with no problems excpet that they can become VERY VERY difficult work with, especially if there are some large 'sub-expressions' in the expression.

             

            I seem to recall that there is a limit - around 20? - or otherwise if you just exceed the max number of chars for an expression. Frankly I would give up long before getting there!

             

            The second suggestion has some significant merit for a neat solution.

             

            Good luck.

             

            Grant

             

              Originally posted by Nick Osdale-Popa:

            What version of Monarch are you using?

            V6 has a lookup formula that should suit your needs quite nice.

             

            Otherwise, try something like these:

            [font="courier"]IF(Language=1,"English", If(Language=2,"Spanish","Eubonics"))[/font][/quote]I'm not sure how many nests Monarch allows, to circumvent the limit you can do this:

            [font="courier"]IF(Language=1,"English","")If(Language=2,"Spanish","")If(Language=3,"Eubonics","")[/font][/quote][/b][/quote]

             

            [size="1"][ February 07, 2003, 09:01 PM: Message edited by: Grant Perkins ][/size]