Moving one column values to other in the same table

  • Hello All

    Let me give a brief description of the problem.

    I have two columns Sex and DOB.

    The sex column has values Male, Female and 01/02/2003,02/12/2001. The dates should go under the DOB column where the corresponding values are Null.

    I would like to move those two Date values from Sex column into the Date column.

    I tried multicast by redirecting to two outputs and joining them again but its causing data duplication. Will it work by using a conditional split on date ?

    Please help me in this.

    Thanks

    Kou

  • Maybe add a couple of derived columns, cSex and cDOB (or whatever) which are set correctly and use these.

    If there's not enough flexibility in there, a script component could easily do the tweaking for you, fixing the contents of the fields on the way through.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I can add derived columns but there are so many such values and so its tough to change all of them. do you know how to use conditional split and then join the two seperate tables back ?

  • sachinvinod2k (5/28/2009)


    I can add derived columns but there are so many such values and so its tough to change all of them. do you know how to use conditional split and then join the two seperate tables back ?

    I do not believe that it would be necessary to do that. We can fix your data as it travels along the pipeline, one way or another, without needing to split it.

    Can you post some sample data which illuminates your problem?

    What do you mean by "many such values"? If you build the fix correctly, it does not matter. Or do you mean many such fields?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Name SSN AGE SEX Race DOB

    Person2 123456789 24 Male 10/23/2006 NULL

    Person4 456789342 27 Female 02/12/2001 NULL

    Person1 AB342134598 23 Male White 1983-04-12 00:00:00.000

    Person3 CND231451 25 Female Asian 2008-12-22 00:00:00.000

    Person5 CKF3546238 36 Male Hisp 2001-01-01 00:00:00.000

    Person6 334546221 34 Male Latino 2003-02-02 00:00:00.000

    I want to move those dates from Race column to corresponding DOB where its empty. I have just shown for two values. There are many other values like that which are totally shifted or misplaced.

    Please suggest something.

    Thanks

    Kou

  • Yuk, I am amazed that anyone would provide you with a file of this quality.

    Is it true that your field delimiter is a space? But then that there is also a space between DOB (date-part) and DOB (time-part)?

    The first thing I would do is complain vigorously to the creator of this rubbish.

    Assuming you have already done that 😉 ... I would use a Script Component to try and sort out this mess. Just read the data values in as a single string per row and break into individual columns in the script.

    Or maybe use

    Name SSN AGE SEX everything_else

    If the first 4 fields are always present - then just use script to split out the 'everything_else' bit.

    Good luck.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Hi

    Thanks for you reply.

    This is not the true file. I just pasted the file from the table, and i guess that is they it has spaces in between them. The original file is even more worser with bad delimiters and junk characters. Its taking one helluva time for me to data clean them.

    I would try that and get back to you.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply