December 28, 2012 at 3:22 am
I want to give conditional statement in dervied column by adding a new column.In band column if Band is B1 then in new column it should be Manager like this If band=C1 then in new column it should be as Developer and if Band=B2 then in new column of that row should be as Tech Lead.How to do this
December 28, 2012 at 6:10 am
krishnasrisatya (12/28/2012)
I want to give conditional statement in dervied column by adding a new column.In band column if Band is B1 then in new column it should be Manager like this If band=C1 then in new column it should be as Developer and if Band=B2 then in new column of that row should be as Tech Lead.How to do this
I'd do this using a lookup rather than a derived column. First create a new table (Band, Description) containing the lookup rows:
B1, Manager
C1, Developer
B2, Tech Lead
And then add an appropriate lookup in your data flow to grab the description. This means that you can accommodate any description changes or additional bands easily without any package changes being necessary.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
December 28, 2012 at 2:23 pm
(DT_STR,50,1252)(band == "C1" ? "Developer" : band == "C2" ? "Tech Lead" : "Something Else")
I added the string conversion "(DT_STR,50,1252)" incase you are inserting into a varchar field. If you are inserting into nvarchar you wont need it.
December 28, 2012 at 2:28 pm
ngreene (12/28/2012)
(DT_STR,50,1252)(band == "C1" ? "Developer" : band == "C2" ? "Tech Lead" : "Something Else")I added the string conversion "(DT_STR,50,1252)" incase you are inserting into a varchar field. If you are inserting into nvarchar you wont need it.
This never returns Manager.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
December 28, 2012 at 2:39 pm
I typed logic wrong, but it demonstrates how to do it.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply