Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Search based on common value within a field

I'm creating a television programming tool in Qlikview for a movie channel, which has the broadcast rights to movies during certain time periods. These time periods are called "availability windows". In Qlikview, I've modeled the data to look like this:

Availability Window

-----------------------

Window ID

Movie

Availability Start (MM/DD/YYYY format)

Availability End (MM/DD/YYYY format)

Let's say I have 2 movies with 3 different availability windows each:

IDMovie
Availability StartAvailability End
1Fury03/01/201603/31/2016
2Fury05/01/201605/15/2016
3Fury08/01/201610/31/2016
4Jurassic World04/01/201605/15/2016
5Jurassic World09/01/201609/15/2016
6Jurassic World12/01/201612/31/2016
7American Sniper01/01/201602/28/2016
8American Sniper06/01/201606/15/2016
9American Sniper12/01/201612/31/2016

In the UI, I'll have a two date pickers tied to two variables: vDateStart, vDateEnd. I'll also have a listbox with two entries in it: "First time availability" and "Last time availability".

"First time availability" should search for movies with an availability window that overlaps the time within vDateStart and vDateEnd but also doesn't have any availability windows that end BEFORE vDateStart.

"Last time availability" should search for movies with an availability window that overlaps the time within vDateStart and vDateEnd but also doesn't have any availability windows AFTER vDateEnd.

So let's say the user selects vDateStart as 03/21/31 and vDateEnd as 06/21/31 and selects first time availability. Qlikview should display the availability windows with IDs 1 and 4.

If the user selects vDateStart as 09/01/2016 and vDateEnd as 09/31/2016 and selects last time availability, Qlikview should only display ID 3 since the last availability window for Fury expires within that date range. It won't show ID 5 because Jurassic World has an availability window after that time range between 12/1/2016 and 12/31/2016.

I couldn't even begin to think of the expression in Qlikview to get what I need. Please help!

10 Replies
sinanozdemir
Specialist III
Specialist III

You are welcome.

I am glad it worked. Let me know if you need anything else with this.