Subscribe Bookmark RSS Feed

Regarding change in data format

kaushik_pushpen

Community Trekker

Joined:

Feb 22, 2015

Hello All,

I have a lot table with a date column in which date are mentioned in two different format like 10/27/2016 & 27-10-2016. I want to put them on another column with a single format to plot the variability chart.

Your suggestion will be helpful.

Pushpendra 

1 ACCEPTED SOLUTION

Accepted Solutions
kaushik_pushpen

Community Trekker

Joined:

Feb 22, 2015

Solution

I have again attached the table.

Please confirm me.

4 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

Here is a script that will work for you

Names Default To Here( 1 );
dt = Current Data Table();

// Assuming the date column to be read is called "Text Date" the following will work
dt << New Column( "Date",
	Format( m / d / y ),
	formula(
		If( Contains( :Text Date, "-" ),
			Informat( :Text Date, "dd/mm/yyyy" ),
			Informat( :Text Date, "mm/dd/yyyy" )
		)
	)
);
Jim
kaushik_pushpen

Community Trekker

Joined:

Feb 22, 2015

Hello Jim,

Thank you for the solution.

I have tried your scrip but didn't get the resuls.

I have attached my table into which  operation will be performed.

Could you please try your script on this table.

 

 

txnelson

Super User

Joined:

Jun 22, 2012

I can not find your attached table
Jim
kaushik_pushpen

Community Trekker

Joined:

Feb 22, 2015

Solution

I have again attached the table.

Please confirm me.