2 Replies Latest reply: Jul 18, 2018 8:42 PM by karthik joshi RSS

    issue with if condition




      I had a if condition in script like


      if([field 1] = 'a',  x, [field 2]) as [field 3]


      so [field 3] should have value x and [field 2] values as per my knowledge.


      But this is not happening in my case.


      Can some help on this.




        • Re: issue with if condition
          Petter Skjolden

          You're correct but with no extra information than this it is hard to know where the problem might be. But the condition has to be within a load statement and all the fields has to exist already in the source table that you load from. Furthermore the [x] and the [field 2] fields has to have these names in the source table - they can't be new field names being created in the same load step.


          Could you please provide us for instance with some test data that proves your point or a test app if possible?

          • Re: issue with if condition
            karthik joshi

            Hi Sai,


            I totally agree with Petter


            As x is value try giving it in quotes :


            Something like:


            if([field 1] = 'a',  'x', [field 2]) as [field 3]