To combine columns in QS

Infosphere's Quality Product

Moderators: chulett, rschirm

Post Reply
divstands
Participant
Posts: 128
Joined: Wed Jun 03, 2009 9:48 am

To combine columns in QS

Post by divstands »

I want to combine few columns, like, Strre name, Ext No, Colony into one single column. I am using the transformer stage for same and

If the input fileds are:
Street
ExtNo
Colony

and the output field is : AddressLine1

then i have put AddressLine1 derivation as : Street:ExtNo:Colony

Now for most of the times ExtNo is a NULL. And because of this all the records are being dropped off. There is no output hence out of the transformer stage.

Please mention if i am missing some property in the Transformer stage
or
Mention an alternative stage to do the above task.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I assume this will work here:

Street:NullToEmpty(ExtNo):Colony

Once you cat a null onto a string, the result is null no matter the other values, so you need to avoid doing that at all costs.
-craig

"You can never have too many knives" -- Logan Nine Fingers
divstands
Participant
Posts: 128
Joined: Wed Jun 03, 2009 9:48 am

Post by divstands »

chulett wrote:I assume this will work here:

Street:NullToEmpty(ExtNo):Colony

Once you cat a null onto a string, the result is null no matter the other values, so you need to avoid doing that at all costs. ...
Okay. In real, there are some 26 fields coming out of standardization stage which i am feeding to the Transformer. All these fields can be NULL if required. Hence, i guess i would need to put this rule to every field right?
JRodriguez
Premium Member
Premium Member
Posts: 425
Joined: Sat Nov 19, 2005 9:26 am
Location: New York City
Contact:

Re: To combine columns in QS

Post by JRodriguez »

DivStands,

The transformer stage is fine ... just handle the nulls values. In this case you should be Ok using NullToEmpty function

Street:NullToEmpty(ExtNo):Colony


divstands wrote:I want to combine few columns, like, Strre name, Ext No, Colony into one single column. I am using the transformer stage for same and

If the input fileds are:
Street
ExtNo
Colony

and the output field is : AddressLine1

then i have put AddressLine1 derivation as : Street:ExtNo:Colony

Now for most of the times ExtNo is a NULL. And because of this all the records are being dropped off. There is no output hence out of the transformer stage.

Please mention if i am missing some property in the Transformer stage
or
Mention an alternative stage to do the above task.
Julio Rodriguez
ETL Developer by choice

"Sure we have lots of reasons for being rude - But no excuses
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

In other words - yes, use it for every field that could be null.
-craig

"You can never have too many knives" -- Logan Nine Fingers
divstands
Participant
Posts: 128
Joined: Wed Jun 03, 2009 9:48 am

Post by divstands »

chulett wrote:I assume this will work here:

Street:NullToEmpty(ExtNo):Colony

Once you cat a null onto a string, the result is null no matter the other values, so you need to avoid doing that at all costs. ...
yes it is working perfectly. Thanx a lot chulett! :)
Post Reply