Building queries in AxioMap

Simple Queries

You can select areas with certain values, or a specified combination of values, isong the query options. Selected areas will be highlighted on the map. You can also generate a list of selected areas with their attributes.

Start by opening a query dialog by clicking the Query button (the left frame expands to display the dialog form). This is how this form looks:


First, map a variable that you want to query. This variable can be "composed" with the Compose dialog. Let's call this variable the "Current variable"

Second, build an expression in the Query window by clicking an operator and typing in a value.

Third, click the Evaluate button, and Listing (if you need the list of selected records).

Let's see how this works in a simple example. Suppose you want to find neighborhoods where the proportion of Hispanic Population is over 10%. First, map the "Hispanic Population" variable from the "1990 Demography" dataset, and convert it to relative form by dividing this variable by total population (i.e., select "Divide" and "Population" under Compose). Then, you can construct the query in the form


"[Current var] > 0.1" 

To build this query expression, you can click the ">" button, and then type in the value.
Click on the "Info" button to get information about the current variable, which will assist you in composing the query.
Make sure you are selecting a "New Set", and click Evaluate: the map will now highlight areas that satisfy the query. If you again click the Info button, it will display query and selection information. Clicking Listing will display currently selected records as a table.
The picture below shows the query and results.

Composite Queries

Composite queries are essentially a sequence of simple queries. Once your first simple query selects several records, you can limit or increase this selection set using variables (from the same or a different dataset, or derived variables). Just map another variable, and choose "Select from set" or "Add to set" before clicking "Evaluate".

For example, to select neighborhoods with Median Rent over $650 from the 9 neighborhoods selected above, switch to "1990 Housing and Income" dataset and select the "Median Rent of Sel Rental Units" variable (make sure that you are not dividing it by the Population variable from the previous query). Then enter


"[Current var] > 650" 

as the query expression. Choose "Select from Set" from the drop-down box, and click Evaluate. The query and results are shown below:

Notice that queries can be built from variables that reside in different datasets, which can themselves be located on different servers.

Try it on your own: a funny example

Here is a fun query example that you can experiment with on your own. Open the Michigan Agriculture Atlas. Let's find counties which had pumpkin farms in 1992, but reported land in pumpkins as zero. Here is how you do it.

  • With the "Agriculture" dataset active, map the "92 Pumpkin Acres" variable, and build a query
    
    "[Current var] = 0" 
    
    
    with the "New Set" option, then click Evaluate.
  • Click Info, and find that 32 counties are currently selected.
  • Then, select the "92 Pumpkin farms" variable, and evaluate the expression
    
    "[Current var] > 0" 
    
    
    with the "Select from Set" option. Now, four counties are selected. Click "Listing" to display them as a table. How would you interpret the results?