I am doing concatenation of two column values if below condition is true
AB_GROUP has the value - 'switch'
AB_SUBGROUP has the value - NULL or empty
Condition
if Biseps_Genericcode.BISEPS_GENERICCODE = hash_Biseps_Genericcode.AB_CODE then hash_Biseps_Genericcode.AB_GROUP:" ":hash_Biseps_Genericcode.AB_SUBGROUP else @NULL
When I tried to concatenate for the above example for the true condition [ 'switch' with 'null' value] , I am getting the result of NULL in the output.
The output should be 'switch' . Why the output field got populated as blank?
concatenation of values with null
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 102
- Joined: Tue Jan 31, 2006 4:13 am
concatenation of values with null
Sujatha K
-
- Participant
- Posts: 106
- Joined: Thu Jun 08, 2006 8:51 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
AB_GROUP : NullToEmpty(AB_SUBGROUP)
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.
-
- Premium Member
- Posts: 102
- Joined: Tue Jan 31, 2006 4:13 am
Thank you. I have used the below expression and the problem is resolved.
if Biseps_Genericcode.BISEPS_GENERICCODE = hash_Biseps_Genericcode.AB_CODE AND not(isnull(hash_Biseps_Genericcode.AB_SUBGROUP)) then hash_Biseps_Genericcode.AB_GROUP:" ": hash_Biseps_Genericcode.AB_SUBGROUP else if Biseps_Genericcode.BISEPS_GENERICCODE = hash_Biseps_Genericcode.AB_CODE AND isnull(hash_Biseps_Genericcode.AB_SUBGROUP) then hash_Biseps_Genericcode.AB_GROUP else @NULL
if Biseps_Genericcode.BISEPS_GENERICCODE = hash_Biseps_Genericcode.AB_CODE AND not(isnull(hash_Biseps_Genericcode.AB_SUBGROUP)) then hash_Biseps_Genericcode.AB_GROUP:" ": hash_Biseps_Genericcode.AB_SUBGROUP else if Biseps_Genericcode.BISEPS_GENERICCODE = hash_Biseps_Genericcode.AB_CODE AND isnull(hash_Biseps_Genericcode.AB_SUBGROUP) then hash_Biseps_Genericcode.AB_GROUP else @NULL
Sujatha K