BookmarkSubscribe
Choose Language Hide Translation Bar
hwchoi0109
New Contributor

Extracting number from numbers

Hi, 

 

I have a question about extracting number from numbers.

 

Let's say I have a data set like this below, which is YYYYMMDDTTMMSS.

 

1.PNG

 

I want to extract YYYY, MM, and DD, seperately and make it like below.

2.PNG

 

What kind of formula should I use to make it like this? Thank you in advance!!

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Extracting number from numbers

You will probably see several different ways to do this. Here is one approach (you will see a pattern):

 

For Year: Num( Substr( Char( :TIME_DATA ), 1, 4 ) )

For Month: Num( Substr( Char( :TIME_DATA ), 5, 2 ) )

For Day: Num( Substr( Char( :TIME_DATA ), 7, 2 ) )

Dan Obermiller
2 REPLIES 2
Highlighted

Re: Extracting number from numbers

You will probably see several different ways to do this. Here is one approach (you will see a pattern):

 

For Year: Num( Substr( Char( :TIME_DATA ), 1, 4 ) )

For Month: Num( Substr( Char( :TIME_DATA ), 5, 2 ) )

For Day: Num( Substr( Char( :TIME_DATA ), 7, 2 ) )

Dan Obermiller
hwchoi0109
New Contributor

Re: Extracting number from numbers

It works really well!! Thank you so much for your help!!

0 Kudos