2 Replies Latest reply on Jan 28, 2013 9:00 AM by RyanThomas

    Case Statment (help!)

    RyanThomas

      Title

      Case Statment (help!)

      Post

           I'm trying to sort out a case statement and could use some help.

           If ( ProgressIndicator2011_12 = ""; ""; Case (

           WIDA_Data2011_for2012::SY11_12 ELP Level = "1" and ProgressIndicator2011_12 < "29"; "Did NOT Meet"; WIDA_Data2011_for2012::SY11_12 ELP Level = "1" and ProgressIndicator2011_12 > "29"; "Met AYP";

           WIDA_Data2011_for2012::SY11_12 ELP Level = "2" and ProgressIndicator2011_12 < "20"; "Did NOT Meet"; WIDA_Data2011_for2012::SY11_12 ELP Level = "2" and ProgressIndicator2011_12 > "20"; "Met AYP";

           WIDA_Data2011_for2012::SY11_12 ELP Level = "3" and ProgressIndicator2011_12 < "14"; "Did NOT Meet"; WIDA_Data2011_for2012::SY11_12 ELP Level = "3" and ProgressIndicator2011_12 > "14"; "Met AYP";

           WIDA_Data2011_for2012::SY11_12 ELP Level = "4" and ProgressIndicator2011_12 < "10"; "Did NOT Meet"; WIDA_Data2011_for2012::SY11_12 ELP Level = "4" and ProgressIndicator2011_12 > "10"; "Met AYP";

           WIDA_Data2011_for2012::SY11_12 ELP Level = "5" and ProgressIndicator2011_12 < "3"; "Did NOT Meet"; WIDA_Data2011_for2012::SY11_12 ELP Level = "5" and ProgressIndicator2011_12 > "3"; "Met AYP"
           ))

            

           Any ideas on what's wrong with this statement?

        • 1. Re: Case Statment (help!)
          philmodjunk

               Numbers and text evaluate differently when you compare them in boolean expressions such as these or when you sort the values into descendint or ascending order.

               "100" < "2"

               Is a true statement. The first character of the string "100" is less than the first character of the string "2". (Think how you sort words into alphabetic order; "Abracadabra" is 'less' than' "Bee".)

               100 < 2

               is a false statement. Without the quotes, you are comparing numbers.

               Thus you should do two things:

               1) Remove the quotation marks around your number values.

               2) Check and make sure that your fields used in the boolean expressions such as WIDA_Data2011_for2012::SY11_12 ELP Level and ProgressIndicator2011_12 are defined to be of type Number when you check their definitions in Manage | Database | Fields.

          • 2. Re: Case Statment (help!)
            RyanThomas

                 Problem solved!  Thank you so much for your reply and clear explaination of boolean logic.