2 Replies Latest reply: Apr 15, 2011 3:56 AM by EduardoGonzalez RSS

    Find value in a field

      Hi everyone,

      I´d like to know how can I do to get a '0' if a value doesn´t exist in a field and a '1' if the value exist.

      For example, I have this table:

      T1:
      LOAD * INLINE [
      F1
      'a'
      'a'
      'a'
      'b'
      'c'
      ];

      And I´d like to know if 'z' value is in the F1 field, getting a '1' or a '0' if the value exist or not.

      I´ve tried this

      tmp:
      LOAD COUNT(DISTINCT F1) as Found RESIDENT T1 WHERE F1='z';

      LET value= peek('Found',0,'tmp');

      But the value is NULL and not '0' when 'z' is not in the table.

       

      Thanks a lot.