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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_brierley
Creator
Creator

if between function

Hi all,

i have the following expression but want to change is slightly so it incorporates some kind of between funciton

=IF(Latitude > Lat1 AND Latitude < Lat2 AND Longitude > Long1 AND Longitude < Long2, Area,'')

thanks all

11 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

There is no between function or operator in Qlikview. In some cases, you can use interval matching to set a flag in the load script, but I don't know how to do that with two matches.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
samuel_brierley
Creator
Creator
Author

thought that was the case, not a huge issue i can write a lengthy if statement to capture all the iterations, not really that many.

engishfaque
Specialist III
Specialist III

Dear Samuel,

Please try listed below script,

--

Load  Area

From YourDataSource

Where Latitude > Lat1

          And Latitude < Lat2

          And Longitude > Long1

          And Longitude < Long2;

Please note, Here in QlikView we use IntervalMatch function instead of Between function.

Kind regards,

Ishfaque Ahmed

samuel_brierley
Creator
Creator
Author

Hi thanks,

unfortunately this is what i tried earlier and because I have 2 different sources i cant get that method to work. what im trying to do is below, id appreciate if you could help solve my problem.

Table1

,,,,

Table2

[1],[2][3]

Table 3

[1]

lookup( ,

where 2 > and 2 < and [3] > and [3] < ,

Table1)

Kushal_Chawda

Create the Flag in Script

IF((Latitude > Lat1 AND Latitude < Lat2) AND (Longitude > Long1 AND Longitude < Long2), 1,0)  as Flag_Lat_Long


Now you can use this Flag in Where Clause or in Chart using set analysis

Kushal_Chawda

Is there any link between Table 1 & table 2?

Anonymous
Not applicable

try this:

=IF((Latitude > Lat1 AND Latitude < Lat2) AND (Longitude > Long1 AND Longitude < Long2), Area,'')


make sure all are in number

samuel_brierley
Creator
Creator
Author

Thanks for the help Kush,

no there isnt a link between the two tables and im trying everything i can think of to get this to work.

i cant get my head around the problem. I know you guiys are far more intelligent than i am so obviously im not explaingin very well.

here we go

[MIDAS]

LOAD [Geographic Address],

     Latitude,

     Longitude

FROM

(qvd);

[AQMA]

LOAD Area,

     Lat1,

     Lat2,

     Long1,

     Long2

FROM

(ooxml, embedded labels, table is Sheet1);

i want the AQMA table to join onto the MIDAS table, as you can see no link, what i want is the =IF(Latitude > Lat1 AND Latitude < Lat2 AND Longitude > Long1 AND Longitude < Long2, Area,'') function to be the criteria for what value is put where.

your help is very much appreciated.

swuehl
MVP
MVP

What about the solution I've suggested to your discussion here:

Lookup with Multiple Criteria