You can select a value in an EQL result and use it to compose a follow-on query.
This enables users to interact with EQL results through a chart or a graph to compose follow-on queries. For example, when viewing a chart of year-to-date sales by country, a user might select a specific country for drill-down.
EQL is specifically designed to support this kind of follow-on query.
If, in the above example, the user selects the country United States, then the follow-on query should examine only sales of products in the United States. To filter to these items, a WHERE clause like the following can be added:
WHERE DimGeography_CountryRegionName = 'United States'
For attributes with types other than string, a conversion is necessary to use the string representation of the value returned by EQL. For an integer attribute, like DimDate_CalendarYear, the string representation of the value must be converted to an integer for filtering, as follows:
WHERE DimDate_CalendarYear = TO_INTEGER('2006').
EQL provides conversions for all non-string data types:
Each of these accepts the string representation of values produced by the Endeca Server. Note that, for mdex:string attributes (including managed attributes), no conversion is necessary.
To determine which conversion function to use, EQL results are accompanied by attribute metadata that describes both the type of the attribute, and, for managed attributes, any associated hierarchy.
When filtering to a node in a hierarchy, such as ProductCategory, users typically want to filter to records that are tagged with a particular value or any of its descendants. For example, if a user drills into Accessories, filtering to records tagged with Accessories will return no results. However, filtering with:
WHERE IS_DESCENDANT(ProductCategory, 'Accessories')
produces the desired result of filtering to records tagged with Accessories or any descendent thereof.