Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Display current time in 12 hour format with AM/PM

Hi All,

I have a Date_D field and it has date and Time field. I want to create a bar chart to see how many call we do each hour in a day....how to create time expression.....

I am trying   ..... class(time(Date_D,2) as my time expression....but it is not showing AM and PM in format..

Thanks in Advance

Sid

Tags (1)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Display current time in 12 hour format with AM/PM

You mean you want a condition to show only certain time-buckets and they should be displayed in a very special format then it might be better to use if-loops for defining the buckets or even better a pick(match()) like:

pick(match(hour(frac(Date_D)), 8,9,10,11,12,13,14,15),

     '8 AM - 10 AM',

     '8 AM - 10 AM',

     '10 AM - 12 PM',

     '10 AM - 12 PM',

     ....)

and then hiding NULL on these dimension.

- Marcus

View solution in original post

4 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Display current time in 12 hour format with AM/PM

Try something like this:

 

class(time(frac(Date_D), 'hh:mm:ss tt'), 1/24 * 2)

respectively reverse:

time(class(frac(Date_D), 1/24 * 2), 'hh:mm:ss tt')

- Marcus

Highlighted
Not applicable

Re: Display current time in 12 hour format with AM/PM

Hi Marcus,

Thanks for you reply !!!

What I needed was like ....

   

Hourfrequency
8 AM-10 AM20
10 AM-12PM19
12 PM - 2 PM21

2 PM-4

PM

16
Highlighted
MVP & Luminary
MVP & Luminary

Re: Display current time in 12 hour format with AM/PM

You mean you want a condition to show only certain time-buckets and they should be displayed in a very special format then it might be better to use if-loops for defining the buckets or even better a pick(match()) like:

pick(match(hour(frac(Date_D)), 8,9,10,11,12,13,14,15),

     '8 AM - 10 AM',

     '8 AM - 10 AM',

     '10 AM - 12 PM',

     '10 AM - 12 PM',

     ....)

and then hiding NULL on these dimension.

- Marcus

View solution in original post

Highlighted
Not applicable

Re: Display current time in 12 hour format with AM/PM

Thanks Marcus !!! you are a saviour !!!