URL Pre-filter
The Flaremap JS URL can be used as a clever mechanism for pre-filtering data before the data is loaded into the application. This URL pre-filter allows users to focus on a specific part of a dataset without having to first apply filters, and/or to analyze a slice of a large database without having to understand or perform complicated database transformations.
No parameter needs to be added to the config file to use this feature.
To use a URL pre-filter, simply use the following format to append the base URL of the application:
{base_url}#tm.prefilter1[.{orGroup}]={filter_spec1}&tm.prefilterN[.{orGroup}]={filter_specN}
By default, multiple pre-filters have an AND relationship; i.e. only results that match all of the pre-filter rules will be returned.
| {base_url} | The core URL of the application. For example: http://www.company.com/flaremap/application.html |
|---|---|
| {orGroup} | Optional. When used, pre-filters with matching {orGroup}s will have an OR relationship – i.e. results that match any of the pre-filters with common {orGroup}s will be returned. The value of {orGroup} can be any unique string. |
| {filter_spec} | Specifies the pre-filter to apply. See {filter_spec} table below for format. |
{filter_spec}
Value: {value_name}|{operation}|{operation_values}
| {filter_spec} item | Value | Explanation |
|---|---|---|
| {value_name} | Any attribute from “CSV_DataTypes.cells” | Specifies the attribute that will be used to pre-filter the data. |
| {operation} | See table below for list of operations | Specifies the operation used to define group membership |
| {operation_values} | See table below for how different operations require different values | Specifies what values the operation uses to determine group membership |
Group operations and values
| Description | {operation} | {operation_values} |
|---|---|---|
| equals | EQ | Any number or string. Will only return results that exactly match the value. Use HASTEXT for more granular text searching. |
| not equals | NEQ | Any number or string. Will only return results that exactly match the value. Use HASTEXT for more granular text searching. |
| less than | LT | Any number |
| less than or equals | LTE | Any number |
| greater than | GT | Any number |
| greater than or equals | GTE | Any number |
| set membership (in a set) | SET | Any pipe separated list of numbers or strings. Will only return results that exactly match the value. Use HASTEXT for more granular text searching. Values within SET have an OR relationship. |
| from (inclusive)... to (inclusive) | [] | Any two pipe separated numbers (the second should be larger than the first) |
| from (not inclusive)... to (inclusive) | (] | Any two pipe separated numbers (the second should be larger than the first) |
| from (inclusive)... to (not inclusive) | [) | Any two pipe separated numbers (the second should be larger than the first) |
| from (not inclusive)... to (not inclusive) | () | Any two pipe separated numbers (the second should be larger than the first) |
| text search | HASTEXT | Any pipe separated list of numbers or strings. Will return any results that match the value, including partial matches. For example “Dan” will return: “Dan”, “Daniel”, and “Dan Smith”. |
| adding an exclamation point immediately before any of the operations above will negate the filter rule | ! | n/a |
Examples:
http://www.company.com/flaremap/application.html#tm.prefilter1=Sales_Region\|EQ\|southeast
http://www.company.com/flaremap/application.html#tm.prefilter1=Sales_Region\|HASTEXT\|north\|south