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: 
Not applicable

Load and Compare @ Load script

Hi,

i want to know how to loop in the load script and compare each row value of a column for example:

Id | Field1 | Field2

a | 123 | 098

b | 456 | 765

c | 789 | 432

i want to loop and compare if

a's Field1 = b's Field1, a's Field1 = c's Field1

b's Field1 = a's Field1, b's Field1 = c's Field1

c's Field1 = a's Field1, a's Field1 = b's Field1

i want to do this in the load script..thanks



11 Replies
Not applicable
Author

its just a trigger to tell the person that there is already a cluster..

so instead of loading the entire data(tons of data), if qlikview detected that there is already a cluster..qlikview will pop an alert that there is one location that has points <5kms near him..

johnw
Champion III
Champion III

Well, if I understand what you want, I have not thought of any way to do it. The way I'm solving the distance problem requires you to load in the entire table. We could detect after the fact if there is a cluster, but not before we read in the original table and do a cartesian join of itself onto itself.

In a procedural language you could probably do something like this:

SET ROW = 0

DO
ADD 1 TO ROW
SET COUNT = 0
FOR I = 1 TO ROW - 1
CALCULATE DISTANCE
IF DISTANCE < 5
ADD 1 TO COUNT
IF COUNT > 5
EXIT SCRIPT WITH ALARM
END IF
END IF
NEXT I
UNTIL NO MORE ROWS

But I don't see a way to convert a regular load into that sort of procedure.