Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
anseglko
Creator
Creator

Pick breaks continuous x-axis

I have a 15 minute interval dimension on x-axis created by 

=Time(event_hour&':'&event_quarter,'hh:mm')

This works and Qlik recognizes it and sets the continuous chart with proper time axis (from 0:00am to 12:00pm):

withoutpick.png

However when I try to use it in pick function like this:

=Pick(vComparison,Selection1, Selection2, Time(event_hour&':'&event_quarter,'hh:mm'))

The x-axis breaks and shows 0.00 to 1.00 instead of hours. 

withpick.png

 

Any way to fix this?

Labels (7)
1 Solution

Accepted Solutions
sunny_talwar

Not so pretty, but a work around still... try this

=$(=Pick($(vPick), 'Interval', 'Time'))(pick($(vPick),event_hour,event_hour&':'&event_quarter),pick($(vPick), 'D', 'hh:mm'))

View solution in original post

10 Replies
sunny_talwar

Are Selection1 and Selection2 fields are also time field? if they are, then may be this

=Time(
    Pick(vComparison, Selection1, Selection2, event_hour&':'&event_quarter)
,'hh:mm')
anseglko
Creator
Creator
Author

Hi,

Unfortunately they are not. They are month and day fields.

sunny_talwar

Not sure, but may be try this

=Pick(vComparison,
   Selection1,
   Selection2,
   Time(Time#(event_hour&':'&event_quarter,'hh:mm'),'hh:mm')
)
anseglko
Creator
Creator
Author

Tried, doesn't work.

I'm starting to think it's a bug in Qlik that can't be fixed.

sunny_talwar

Not really sure because I have not tested it. If you are able to share a sample qvf where we can see the issue, I am more than happy to check it out.

anseglko
Creator
Creator
Author

Here is a sample qvf with event_hour and event_quarter and some random values. The top graph shows the x-axis misbehaving when using pick, and the bottom chart shows the  same thing working without pick.

(Press button 2 to switch to the event_hour&':'&event_quarter dimension)

sunny_talwar

Not so pretty, but a work around still... try this

=$(=Pick($(vPick), 'Interval', 'Time'))(pick($(vPick),event_hour,event_hour&':'&event_quarter),pick($(vPick), 'D', 'hh:mm'))
anseglko
Creator
Creator
Author

Interesting. That works well on the Desktop app, but not in the web app. Still have time range from 0.00 to 1.00. Great solution though! No idea why it doesn't work in web app.

sunny_talwar

May be desktop and web have different versions?