• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » 3 or more fields values in one out

#1 2008-04-09 21:16:53

johnvkumar
Member
Registered: 2008-03-20
Posts: 22

3 or more fields values in one out

Hi, I am not able figure out how to do the following

IF FIELD1 is NULL THEN
   IF FIELD2 is NULL THEN
         IF FIELD3 is NULL THEN
              PUT  NULL into OUT1
         ELSE
                PUT  FIELD3 into OUT1
         END
   ELSE
     PUT  FIELD2 into OUT1
   END
ELSE
  put FIELD1 into OUT1
END

thx and appreciate your help.

Offline

#2 2008-04-09 21:29:00

Volker Brehm
Member
Registered: 2007-04-03
Posts: 1139
Website

Re: 3 or more fields values in one out

You can use a tJavaRow and add the java code or use the ?:-Operator in a tMap (code not tested):

Code:

rowX.FIELD1 == null ? (rowX.FIELD2 == null ? rowX.FIELD3 : rowX.FIELD2) : rowX.FIELD1

Bye
Volker

Last edited by Volker Brehm (2008-04-09 21:29:25)

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » 3 or more fields values in one out

Board footer

Powered by FluxBB