Page 1 of 1

logic required

Posted: Tue Jan 31, 2012 3:28 am
by udayk_2007
Hello Friends

I have a requirement where if either of values are present then i need to put a particular value in other column.This can be done using a IF-ELSE statement but the problem here is a lot of values to be checked. For ex

If column A IN ('A','B','C'......15 values) then Column B='Value'

Any simpler way to implement this.

Thanks in advance

Regards
Ulhas

Posted: Tue Jan 31, 2012 3:38 am
by ray.wurlod
Search DSXchange for solutions using the Index() function.

Posted: Fri Feb 03, 2012 3:35 pm
by RAJARP
Ray,

This can be achived by using the mix of 'looping' capacicty of transformer and index() function.

Is this what you have intended/hinted?


Regards,
Raja R P

Posted: Fri Feb 03, 2012 7:01 pm
by qt_ky
No need for looping. Use Index() or a Lookup stage.

Posted: Fri Feb 03, 2012 8:51 pm
by ray.wurlod
As noted, you don't need a loop. A single Index() function can check all possible values. Delimit them, and the search string, with some character (space will do). For example, the following function will return 0 if not found and some non-zero value if found.

Code: Select all

Index(" A B C D E F G H I J K L M N O ", " " : InLink.ColumnA : " ", 1)

Posted: Fri Feb 10, 2012 12:28 am
by udayk_2007
Thanks All

I used Index() function and it worked

Regards
Ulhas