Proximity searches "near" and "farther than

If your table contains Latitude and Longitude data, you can use proximity searches that find entities related to each other by location.

Proximity keywords allow you to search for data on locations near or farther than n number of miles from a specified location.

For example, you could search for sales by store county near santa clara county within 50 miles, or sales by store city farther than 50 miles from santa clara county.

Note that you can only use the near and farther than keywords on data sources that have latitude and longitude data. The latitude and longitude columns must be configured as geographical data.

The near keyword

Proximity search with the near keyword

The farther than keyword

Proximity search with the farther than keyword

Proximity search syntax

There are two proximity search keywords: near and farther than. Here is the syntax for these keywords:

  • <column> near <location>

    example: store city near tokyo

  • <column> near <location> within <n> (miles | km | meters)

    example: store city near tokyo within 50 miles

  • <column> farther than <n> (miles | km | meters) from <location>

    example: store city farther than 50 miles from tokyo

Store city in these examples refers to the name of the column that tokyo falls under in the data. You must specify the name of the column for the location you are searching on before entering the near or farther than keyword.

How proximity search works

ThoughtSpot calculates the distance from the location you specify in a proximity search as a straight-line distance (not road distance) radius, using miles, kilometers, or meters from the central point. If you do not specify a distance, the system uses 10 km as the default.

To increase the 10 km default, contact ThoughtSpot Support.

Given a location and an optional distance, the search returns all instances of a geotype column that fall within the parameters. For example, for the near santa clara county search, the system searches for rows with santa clara county in it and finds the corresponding latitude and longitude columns. The system can handle up to 30 latitude/ longitude pairs for a given geographical value, like a city, country, or county. Then, ThoughtSpot finds all latitude/ longitude pairs with a direct distance of less than 10 km or a specified distance from the santa clara county latitude/ longitude pairs.

To increase the maximum number of latitude/ longitude pairs that can be associated with a given geographical value, contact ThoughtSpot Support.

You can add any additional filtering to your query.

Proximity search configuration requirements

  • You must use a single data source, like a table, Worksheet, or View, to run a proximity search. You cannot search on two different tables, related by a join, like you can in a typical ThoughtSpot search. To search on two (or more) different tables, create a Worksheet that contains data from those tables and use the Worksheet as your data source.

  • Your data source must contain exactly one column of type longitude and exactly one column of type latitude.

  • Your administrators must configure the latitude and longitude columns using the appropriate GeoType.

  • Your administrators must enable this feature. If you are having trouble using proximity search, and all other configuration requirements are met, the feature may be turned off. Ask your administrator to contact ThoughtSpot Support to turn the feature on.



Was this page helpful?