Using an EQL query to generate the set of locations

You can use an EQL query to generate a set of locations for a Map component. If you have more than one location set, then all but one must use an EQL query to generate the location list. The EQL query must include a geospatial attribute, as well as any attributes you want to be able to display and sort by for each location.

For example, for a list of transactions, the data may include the geographic location of each customer. You could then use an EQL query to generate a unique list of customer addresses to display on the map.

RETURN Customers AS
SELECT LatLong as LatLong, Customer_Name as Customer_Name, Customer_Address as Customer_Address, Cities as Cities, States as States 
GROUP BY Customer_Id

Or, if your transaction data includes geographic locations for both stores and suppliers, you could use an EQL query to get just the stores or just the suppliers.

RETURN Exporters AS
SELECT LatLong as LatLong, Customer_Name as Customer_Name, Customer_Address as Customer_Address, Cities as Cities, States as States 
WHERE Business_Types = 'Exporter' 
GROUP BY Customer_Id

To provide the EQL query to generate the location set:

  1. Check the Use EQL query checkbox.
    EQL query section on a location set tab on the Map component edit view before the query is provided

    Note that if you already have a location set that doesn't use an EQL query, then all of the other location sets must use EQL. The checkbox is checked and disabled.

  2. In the text area, enter the EQL query.

    The query results must include a geospatial attribute, as well as any attributes you want to include for each location.

  3. After entering the query, click Test EQL Query.

    If the EQL query is valid, then the Load button is enabled.

    EQL section for a location set on the Map component edit view after the query is validated
  4. To load the EQL query, click Load.

    The Attribute Groups list is updated to display the attributes from the EQL query.