If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
I have two tables.
QVT_Object: Zip code from objects
VC_VertGebietDef: ZIP Code Areas
I would like to assign the zip code from the "QVT_Object" to the zip code areas from the "VC_VertGebietDef".
I've already tried it like this:
if(NUM([QVT_Object.zipcode]) >= NUM(VC_VertGebietDef.Zipcode_min) and NUM([QVT_Object.zipcode]) <= NUM(VC_VertGebietDef.Zipcode_max), VC_VertGebietDef.Zipcode_min & ' - ' & VC_VertGebietDef.Zipcode_max, null())
Unfortunately it doesn't work. Do any of you know?
The result should look like this:
This sounds like a job for IntervalMatch()
Sales:Load * INLINE [Zipcode, Sales01568, 100058091, 5800059889, 300021769, 14000];
Zip:Load *, Zipcode_min & '-' & Zipcode_max as Zip INLINE [Zipcode_min, Zipcode_max01000, 0399956000, 5899959000, 59000];
Left join IntervalMatch(Zipcode) Load Zipcode_min, Zipcode_maxResident Zip;
Note that your expected result doesn't match your actual values - 59889 is not in the range 59000 - 59000.
View solution in original post
Thank you for your support.
It works exactly how I need it 👍
You're right, I made a mistake in the example 😁