i am doing the concatenation of a
concatenation of four column into a single column
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 36
- Joined: Fri May 21, 2010 12:40 am
- Location: Bangalore
concatenation of four column into a single column
I have four input column, a,b,c and d where in the output column is E
i am doing the concatenation of a
c:d to give the output E. But my problem is even if any of the four input column is null the E column should concatenate other three fields and give the output . It should not be null. Only case where it can be null is when all the four fields are null. I have solution for this that is using stage variables. Please let me know if you have any other solutions to this.
i am doing the concatenation of a
Sandeep Chandrashekar
-
- Participant
- Posts: 36
- Joined: Fri May 21, 2010 12:40 am
- Location: Bangalore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You want to allow for null output, so you will need an If..Then..Else to cover the possibility that all source columns are null.
Code: Select all
If IsNull(InLink.colA) And IsNull(InLink.colB) And IsNull(InLink.colC) And IsNull(InLink.colD) Then @NULL Else NullToEmpty(InLink.colA) : NullToEmpty(InLink.colB) : NullToEmpty(InLink.colC) : NullToEmpty(InLink.colD)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: