Hi,
I have a scenario where incoming column value needs to be compared, ex
If Src.Col1=A then 01
If Src.Col1=B then 02
.
.
If Src.Col1=F then 07
How can I parameterize it in a situation when the values of Col1 are dynamic.
Thanks,
Parameters for IF condition
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
There are too many ways to do this to answer, at least given the information in the request. If your column length is always 1 and starts with "A" you could index with a simple SEQ(In.Col)-64 to get a number. If you column is of variable length then this method won't work, but if all columns are of equal length you could use the INDEX() function to locate a substring text and return a position (which you can divide by the length to get a numeric series of answers without holes)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
Hi Andrw,
The column lenght is not always the same, its varchar(3), I dont get it when you say all columns, I am asking about just one column, which has multiple values and if there is a new value added in the source (like AAW) then I want to avoid changing the if statement in the job.
The column lenght is not always the same, its varchar(3), I dont get it when you say all columns, I am asking about just one column, which has multiple values and if there is a new value added in the source (like AAW) then I want to avoid changing the if statement in the job.
Thanks,
Vinay
Vinay
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: