AnsweredAssumed Answered

Unexpected Case Statement result

Question asked by IsaacKnoflicek on Jun 24, 2014
Latest reply on Jun 25, 2014 by philmodjunk

Title

Unexpected Case Statement result

Post

     I've got a very strange issue with case statements in a calculated field.  The field is supposed to check a boolean value (groups:isgenetics), if it's empty then return the first item in the Funding Strings value list, if it's 1 then return some static text.  Here's the statement:

     Case ( 
      
     IsEmpty(Groups::isGenetics);GetValue ( ValueListItems ( Get ( FileName ) ; "Funding Strings" ); 1 );
      
     Groups::isGenetics = 1; "Whatever";
      
     Self
      )
      
     For some reason when I use this it ALWAYS returns the first item of the funding strings value list.  That suggests an issue with the conditions, but if I replace the result of the first condition to something like this:
      
          Case ( 
           
          IsEmpty(Groups::isGenetics);"Whenever";
           
          Groups::isGenetics = 1; "Whatever";
           
          Self
           )

     Then it works correctly.  So somehow the calcuated result, the GetValue ( ValueListItems ( Get ( FileName ) ; "Funding Strings" ); 1 ), is screwing up the condition.

     It's not a positional thing either, I tried swapping the order and the result is the same.  Any ideas?

     Thanks,

     Isaac

Outcomes