Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Time format.

Hi folks,

Can anyone advise me on how could I convert the time dimension from 24-hour to 12-hour format?

Sample script:

Time_DIM:

Load

     time(frac(time_column),'HH12:MMSmiley FrustratedS AM/PM');

     @or

     time(frac(time_column),'HH12:MMSmiley FrustratedS');

From Time_DIM.xls;

Thanks.

Best Regards,

R

1 Solution

Accepted Solutions
arjunkrishnan
Contributor II

Re: Time format.

Hai Asok Try This One

SET TimeFormat='h:mm:ss TT';

time(frac(time_column),'$(TimeFormat)');

'h:mm:ss'--->24 hrs Format

h:mm:ss TT-->12 hrs Format->Time Value In--->AM/PM

7 Replies
brijesh1991
Valued Contributor

Re: Time format.

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';

arjunkrishnan
Contributor II

Re: Time format.

Hai Asok Try This One

SET TimeFormat='h:mm:ss TT';

time(frac(time_column),'$(TimeFormat)');

'h:mm:ss'--->24 hrs Format

h:mm:ss TT-->12 hrs Format->Time Value In--->AM/PM

MVP & Luminary
MVP & Luminary

Re: Time format.

Hi,

Try like this

=Time(time_column, 'hh:mm:ss TT')

Regards,

Jagan.

er_mohit
Honored Contributor II

Re: Time format.

simply use it on script side

timestamp(time_coloumn,'hh:mm:ss TT') as Time

amit_saini
Honored Contributor III

Re: Time format.

Hi Ram,

Try this:

=Time(Your_Time_filed, 'hh:mm:ss TT')

Thanks,
AS

Not applicable

Re: Time format.

Hi guys,

The formats you guys stated worked, but am not getting the correct output. Have a look at the screenshot below:

TimeStampProb3.jpg

Am only getting all the hours with 12 minutes  in between, its not a full 24hours cycle with 1second intervals as expected. Please advise.

Thanks.

Best Regards,

R

Not applicable

Re: Time format.

Hi guys,

Its alright, found a out solution to it. Thanks!

Best Regards,

R