1 Reply Latest reply on Sep 26, 2016 2:52 AM by ra.sae.0

# Split Data and Convert into minutes

Hello everyone,

I have a dataset which has the values containing time measurement into mins, hours and mins. E.g 1h10min.

Can anyone help me to split it or create some calculated field so that I can easily count the total minutes. E.g 1h10min will make 70 mins.

Ankit

 1h10min
• ###### 1. Re: Split Data and Convert into minutes

Hi Ankit,

if CONTAINS([Time],'d')

and

CONTAINS([Time],'h')

and

CONTAINS([Time],'min')

then

zn(int(split([Time],'d',1))*24*60)

+

zn(int(split(split([Time],'d',2),'h',1))*60)

+

zn(int(split(split([Time],'h',2),'min',1)))

ELSEif  CONTAINS([Time],'h')

and

CONTAINS([Time],'min')

then

zn(int(split([Time],'h',1))*60)

+

zn(int(split(split([Time],'h',2),'min',1)))

ELSEif CONTAINS([Time],'d')

and

CONTAINS([Time],'min')

then

zn(int(split([Time],'d',1))*24*60)

+

zn(int(split(split([Time],'d',2),'min',1)))

ELSEif  CONTAINS([Time],'h')

then

zn(int(split([Time],'h',1))*60)

ELSE

zn(int(split([Time],'min',1)))

END