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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
JeffMelon
Contributor II
Contributor II

Selecting map layer data calculated using variables

Hi,

 Is there a way to select all area locations within a map layer that contains location data calculated through variables/variable input boxes?

The snip below shows a portion of the map I currently have, each different colored area is it's own Area Layer. Each area's color may change as users different values in the input box; users would then like select a colored area, for example "Red", and the map filter for all Red areas, not the individual Red area. 

Is this achievable? 

 

JeffMelon_0-1674154860741.png

Thank You

Jeff Melon

 

Labels (1)
1 Solution

Accepted Solutions
KGalloway
Creator II
Creator II

I think I have a partial solution. The method described below works for me.

1. I created the following test data:

KGalloway_0-1674660319864.png

The first three columns are loaded in the load script, but the average values are calculated in the chart.

2. I colored the map based on the average values and the following logic: >6 is red, then >3 is yellow, else is green.

KGalloway_1-1674660385807.png

3. Finally, I created 3 buttons that make selections in the Country field when clicked. The key is how the buttons choose to make selections.  Set the button function to 'Select values matching search criteria' and set the value to some variation of '("' & concat(if((value1 + value2) / 2 > 3 and (value1 + value2) / 2 <= 6, Country), '"|"') & '")'  where the exact conditions of the if statement vary based on which values you want to pick. This example picks RUS. 

My example is simple, but I think you may be able to adjust it to fit your needs by replacing the if statement conditions with your specific requirements.

View solution in original post

4 Replies
KGalloway
Creator II
Creator II

Hi Jeff,

I don't think there is a way to do that in the Map object. You could create buttons that make selections in the field based on the values you've used to define the colors.

For example,

If the user inputs 12 to highlight counties with a value of 12 as red, you could have a button that selects all counties with a value of 12. 

If you provide a little more information about the data, I could try to create some sample code that would do this.

JeffMelon
Contributor II
Contributor II
Author

All the areas on the map are zip code locations. What designates their color is two things, one being the result of a few variable stored expressions that rank win/loss/no change for sales performance forecast, two being the values entered in the variable input box for estimated growth and the name. 

KGalloway
Creator II
Creator II

I think I have a partial solution. The method described below works for me.

1. I created the following test data:

KGalloway_0-1674660319864.png

The first three columns are loaded in the load script, but the average values are calculated in the chart.

2. I colored the map based on the average values and the following logic: >6 is red, then >3 is yellow, else is green.

KGalloway_1-1674660385807.png

3. Finally, I created 3 buttons that make selections in the Country field when clicked. The key is how the buttons choose to make selections.  Set the button function to 'Select values matching search criteria' and set the value to some variation of '("' & concat(if((value1 + value2) / 2 > 3 and (value1 + value2) / 2 <= 6, Country), '"|"') & '")'  where the exact conditions of the if statement vary based on which values you want to pick. This example picks RUS. 

My example is simple, but I think you may be able to adjust it to fit your needs by replacing the if statement conditions with your specific requirements.

JeffMelon
Contributor II
Contributor II
Author

Thank you, applying that logic and formulas it finally works. Much appreciated!!