I wish to create an expression for a pop-up for my polygon feature layer (counties) that interrogates an overlapping point feature layer (samples).
I will relate and filter the values using a field titled 'county_name'.
The attribute table for 'samples' consists of:
| county_name | surveyed | a | b |
| A | 2005 | High | Low |
| A | 2006 | High | Low |
| A | 2006 | Low | Medium |
| B | 2007 | Low | High |
| B | 2008 | Medium | Low |
| B | 2008 | Medium | Medium |
| C | 2009 | High | Low |
When a user clicks in a relevant county in my map, I wish the pop-up to do the following:
- list county name;
- list relevant survey year;
- count the number of categories for each sample type by category (eg. A, 2005, a 1 High, b, 1 Low; A, 2006, a 1 High, a 1 Low, b 1 Low, b 1 Medium; ...... B, 2008, a 2 Medium, b 1 Low, b 1 Medium);
- using return values use an If,Then,Else process to colour code the returned value into a range of colours.
Issue I have run into is how to get the range of surveyed years and access sampling categories. My current code will filter by 'county_name' and give a total count of samples within county but breaking down further into more detail has me stumped.
What I think will need to happen is create one expression and possibly repeat it several times for either each year or each sampling category and build responses into some HTML code for a custom table in the pop-up.
Any advice appreciated.
Regards,
Craig