Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trigger with multiple field expression?

I'm trying to add a feature in my Qlikview application where a user can search for eligible movies based on a date range.

I have an object called Movie, it looks like this:

Movie

-------

MovieId

MovieName

WindowStart (MM/DD/YYYY)

WindowEnd (MM/DD/YYYY)

In my QlikView application, I want a user to be able to select a date range, and if at least one day within a movie's time window falls within that date range, it should show up as an eligible result. Right now, I have two calendar objects, Start Date and End Date. Both of them are selecting variables named vStartDate and vEndDate, respectively.

I'm trying to add a trigger action when either variable changes. I need the expression to look like this logic:

All movies within:

vStartDate<= MovieEnd <= vEndDate OR

vStartDate<= MovieBegin <= vEndDate OR

(MovieBegin <= vStartDate AND MovieEnd >= vEndDate

It's that third scenario that has me stumped. I don't know how to add multiple fields and then have the expression use both fields in the trigger action.

1 Reply
ecolomer
Master II
Master II

I had a similar problem and I resolved

I generate a Calendar with limits ...

FEC_LIM:

LOAD

  Min("DEBUT_CHANTIER") as FechaMin,

  Max("FIN_CHANTIER") as FechaMax

resident TAR;

LET vMin=num(Peek('FechaMin',0,'FEC_LIM'));

LET vMax=num(Peek('FechaMax',0,'FEC_LIM'));

CAL:

LOAD

  Date(IterNo()+$(vMin)-1)   as CFecha,

  Year(Date(IterNo()+$(vMin)-1)) as CAño,

  Month(Date(IterNo()+$(vMin)-1))  as CMes,

  Week(Date(IterNo()+$(vMin)-1))   as CSemana,

  WeekStart(Date(IterNo()+$(vMin)-1)) as CSemIni,

  WeekEnd(Date(IterNo()+$(vMin)-1)) as CSemFin

  AutoGenerate 1 While IterNo()+$(vMin)-1<=$(vMax);

Ans select the dates ...