Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mellerbeck
Creator II
Creator II

Reference Line on Y Axis when using time

I have a chart that has Times on the Y Axis created with an time(floor(ADate, 1/24),'hh TT') as Chart_Time expression

for example

6 AM

7 AM

8 AM

I am trying to add a vertical reference line on 7 AM

I've tried

=7

='7'

='7 AM'

=time('07 AM','hh TT')

and haven't hit on it, any thoughts?

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Did you put it on the Y-axis instead of X-axis?  To put a reference line on the X-axis, you need to select "continuous" for the dimension.  Use the number tab to fix the formatting.  An X-axis reference line defined with either of the expressions above then works just fine for me.

View solution in original post

13 Replies
sbaldwin
Partner - Creator III
Partner - Creator III

Hi, have you tried in the axis tab of your chart props change the dimension axis to continus, then you can add a reference line (there is a radio button to allow this after you click add.)

Thanks

Steve

IAMDV
Luminary Alumni
Luminary Alumni

Please can you post the sample QV document? Possible?

Cheers - DV

sbaldwin
Partner - Creator III
Partner - Creator III

something like this?

swuehl
MVP
MVP

I believe that time is represented by the decimal places in numerical representation.

Have you tried

=7 / 24

as expression to represent 7 am?

Regards,

Stefan

mellerbeck
Creator II
Creator II
Author

Thanks all, still struggling with this. I attempted swuehl suggestion but not joy attached is an example of the chart I am trying to add the vertical time line at 7 AM

mellerbeck
Creator II
Creator II
Author

Thanks sbaldwin, very close but the dimension is actually in time format

mellerbeck
Creator II
Creator II
Author

See my reply below, I attached a sample.

johnw
Champion III
Champion III

Chart_Time isn't a time, it's a timestamp.  You don't display the date, but it's still there.  If you want to keep the date, I highly recommend displaying it to avoid the exact kind of confusion you just went through.  However, then asking for a reference line at 7:00 AM makes no sense to me because on which DATE do you want that line?  All of them?  The first one?

If you don't want the date in your time, then strip it out using something like frac().  Then if you use a continuous axis, something like the suggested 7/24 or your time('07 AM','hh TT') should work fine.

mellerbeck
Creator II
Creator II
Author

Thanks John! That is making a lot more sense now! Assuming I wanted to make a reference line on the date and time how would I do that?

I tried changing chart_time to be

timestamp(floor(Trsx_CreationDate, 1/24)) as Chart_Time

And then adding a refernce line with

='9/9/2011 9:00:00 AM'

=Timestamp('9/9/2011 9:01:00 AM')

But so far no Joy.