Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Duplicate Hours in Listbox

Hello,

I am trying to get visits within 36 hrs. Here is what I have:

Interval(ReArrivalDateTime-DepartDateTime,'hh') as ReVisitHrs

Then I am using a Listbox with Field 'ReVisitHrs' for selecting specific hrs. The problem is that the listbox shows duplicate hours such as 01, 01, 01 instead of just 01. How can I fix the logic for listbox to not contain duplicate values?

Example:

ReArrivalDateTimeDepartDateTimeReVisitHrs
9/3/2016 19:349/3/2016 17:5001
9/15/2016 21:379/15/2016 20:3601

Current Listbox display:

ReVisitHrs
01
01

Thank you.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

My bad, you are right.Try this:

Interval(Round(ReArrivalDateTime-DepartDateTime, 1/24),'hh')

View solution in original post

5 Replies
sunny_talwar

Try using Hour instead of Interval:

Hour(ReArrivalDateTime-DepartDateTime)

Anonymous
Not applicable
Author

That did not work. I see using Interval is giving me the right hrs difference but it's just that it is displaying duplicates in the listbox. I am wondering if I can just use a Listbox expression such as IF(ReVisitHrs>=0 and ReVisitHrs<=36, 'Visit within 36hrs', 'No Match'). Not getting it right yet. Thanks.

sunny_talwar

My bad, you are right.Try this:

Interval(Round(ReArrivalDateTime-DepartDateTime, 1/24),'hh')

Anonymous
Not applicable
Author

Great. That did the trick. Thanks so much once again Sunny.

sunny_talwar

No problem Vishal