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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Autogenerate data

I am a newbie in QlikView scripting.

I want to write a QV-script to autogenerate a postal code QVD file with all possible Dutch postalcodes from 1000aa to 9999zz

How do I write this in QV script?

Thanks in advance.

Labels (1)
1 Reply
prieper
Master II
Master II

Am not sure, whether all digits and letters are used actually in Holland (adding to some 6 Mio records), but here is goes:

FOR i=97 TO 122
Letter:
LOAD
CHR($(i)) AS Letter
AUTOGENERATE
1;
NEXT i;

JOIN (Letter) LOAD Letter AS Letter2 RESIDENT Letter;

FOR i = 1000 TO 9999
Digits:
LOAD
$(i) AS Digit
AUTOGENERATE
1;
NEXT i;

DigitLetter:
JOIN (Digits) LOAD * RESIDENT Letter;
DROP TABLE Letter;

ZIP:
LOAD
Digit & Letter & Letter2 AS ZIP
RESIDENT
Digits;

DROP TABLE Digits;


HTH
Peter