Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Retrieve a value from a resident table

HI,

I'm sorry to ask this because I feel this is a piece of cake. But I searched for quite some time and cannot make out how to achieve this.

I got a table with ZIP codes and GPS coords:


LOAD ZIP as GEO_ZIP,
Latitude as GEO_Latitude,
Longitude as GEO_Longitude
FROM Data\GEO\ZIP.xlsx
(ooxml, embedded labels);


Now if want to show data in another table filtered by the GPS coords. So I have an input box to enter a ZIP code.

Now I need to lookup the relevant GPS coords and use them to filter the table.

How can I get the Longitude/Latitude into variables or do this in any other way? Do I need to write a macro? I tried a triggered "Field Selection" with field: GEO_ZIP and Search Item: $(myZIP) and myZIP, but that simply kills the selection for GEO_ZIP.

I must add that I will need to repeat this for up to 50 ZIP codes in parallel.

Thanks for any kind of support.

Best regards,

Georg

5 Replies
Not applicable
Author

Please let mt know if I need to clarify the setup or my question.

In short it is: How to retrieve values from a reident table looking up with a value from a variable and store the looked up values into other variables.

Best regards,
Georg

Not applicable
Author

Instead of using an input box for the cirteria, have you tried using a search object?

Not applicable
Author

Yes, but I don't see how that would ever get me the result into a variable..?

Selecting the ZIP in my case is a step I need to do to have a second table filtered with the results of the lookup in the first table.

input box: vMy_Zip

table "ZIP_coords"

ZIP Lon Lat
22408 51,3434 26,23322
22412 52,34343 25,11111
...

table "locations"

51,3434 26,23322 LocationA
...

Entering 22408 in the input box shall retrieve or just show "LocationA" in table "locations".

Best,
Georg

Not applicable
Author

Hi,

If i understood it you can create two variables like that.

After selecting the GEO_ZIP it automatically updates the variables.

$GeoLat = max(GEO_Latitude)

$GeoLong = max(GEO_Max)

After that you can use these variables in set analysis and filter your data.

Not applicable
Author

As I wrote I will have to do this for 50 locations. And if I "select" it I will have to make 50 "copies" of that table. What's more I do not understand how or where to use your statement. I think it is not a macro. So I wonder where to put it? If you could offer me some more explanation I'd be gratefuil.

I rather thought it would be possible to have a macro rtiggered that will look up the values in the table and write it to the variables. I'm very familiar with VB -- but not with the QV object model. So any advise is appreciated.

Best,
Georg