5 Replies Latest reply: Oct 21, 2014 10:11 AM by Byron Van Wyk RSS

    Exists Question

    Byron Van Wyk

      Hi,

       

      In my load statement I have the following conditional where clause

       

      WHERE exists(PropertyID) and exists(AccommodationTypeID,AccomTypeID)

       

      Instead of applying during load, I want to create a flag for this condition, using the following expression in the load field section

       

      if(exists(PropertyID) and exists(AccommodationTypeID,AccomTypeID),1,0) as PropertyIDFLAG

       

      The PropertyIDFLAG does not flag the same fields as that of my conditional where. Could someone explain why

       

       

      Thanks,

      Byron

        • Re: Exists Question
          Antonio Mancini

          Hi Byron,

          I think that If() works on the already  records loaded at the moment, in a different way Where.

          Regards,

          Antonio

          • Re: Exists Question
            Martin Pohl

            Hello Byron,

             

            in the load statement you load fields within values exists 1 and exists 2.

            But they don't have to be in the same line.

            In the Flagstatement the condition is checked in each line and the flag is only set if the flags exists in both fields.

            For same result you need an or, I think

             

            Regards

              • Re: Exists Question
                Byron Van Wyk

                Hi Martin,

                 

                Tried the or approach and that did not work either. I will give anbu's suggestion a try even though I am doing this on the main load, not a resident but will create a resident load to test this approach. I find it odd that in the exists clause it handles the expression exactly like I want but as soon as I load it as a calculated field it does not.

                 

                Will reply as soon as I have checked both responses

                 

                 

                Cheers,

                Byron