Page 1 of 1

To combine columns in QS

Posted: Tue Jun 16, 2009 12:24 pm
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.

Posted: Tue Jun 16, 2009 12:40 pm
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.

Posted: Tue Jun 16, 2009 12:48 pm
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?

Re: To combine columns in QS

Posted: Tue Jun 16, 2009 12:49 pm
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.

Posted: Tue Jun 16, 2009 1:21 pm
by chulett
In other words - yes, use it for every field that could be null.

Posted: Tue Jun 16, 2009 2:42 pm
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! :)