Replace on conditional expression
Hi Guys,
I need to replace empty or null columns with this string word “RETURN”
However the requirement is conditional base, example like below
Column Names :[Flag], [QTY] and [State]
Date Type: [FLAG] [DT_WSTR,25]
[QTY] (DT_R4]
[state] [DT_WSTR,25]
All I want is whenever FLAG == “I” && [QTY] < 0, then the STATE has to replace with “RETURN”.
Thanks,
D
November 2nd, 2010 10:41pm
Use a derived column transform.
Under "Derived Column" select, "Replace 'STATE'". The expression would be something like:
FLAG == “I” && [QTY] < 0? "RETURN" : [STATE]
Craig Bryden - Please mark correct answers
Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2010 10:55pm
You cannot put [QTY] < 0, because its boolean. This will give error, need to something else. Also, all other columns are string data type.
November 2nd, 2010 11:17pm
You cannot put [QTY] < 0, because its boolean. This will give error, need to something else. Also, all other columns are string data type.
In the original post you said Qty is DT_R4. So what is data type of Qty?Nitesh Rai- Please mark the post as answered if it answers your question
Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2010 11:21pm
I actually don't understand why you say this cannot be done. Assuming Qty is a numeric data type this should work.
Have you tried it?
Craig Bryden - Please mark correct answers
November 2nd, 2010 11:42pm
Hi Nitesh,
You are right, flag is DT_R4 and the remaining columns are string.
Thanks,
Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2010 11:54pm
Oh! I think you are trying to use the expression
FLAG == “I” && [QTY] < 0 in a conditional split which is not the appropriate transformation in this case. You have to use the derived column component.Nitesh Rai- Please mark the post as answered if it answers your question
November 2nd, 2010 11:56pm