MicroStrategy ONE

Using the Location of a Mobile Device to Filter Data: Geo Location Prompt

You can use Geo Location prompts to filter data in a report, document, or Map widget by using an iPhone, iPad, or Android device's current geographic location. For example, a Map widget displays several locations as markers on the map display. You can choose to display only those location markers that are in the same state, city, or zip code as the mobile device's current location.

You can:

  • Automatically use the mobile device's current longitude and latitude to filter report results. To do this, you must define two Value prompts, one for latitude and one for longitude. The prompts are then automatically answered and are not presented to the user in the mobile device interface.
  • Filter a list of attribute elements in a prompt using the current location of the mobile device. For example, you can filter a list of answers in an Attribute Element prompt, to display a list of only the stores located in the current city. To do this, you must define an Attribute Element prompt with the display style set to Geo Location.

The location name that is returned by a Geo Location prompt is based on Google's geocoding. The prompt determines your longitude and latitude using your mobile device's GPS receiver, and passes this information to Google Maps to return information about your location.

To use an Attribute Element prompt to filter attribute elements based on the location of the mobile device, you must provide a location mapping attribute that maps Google's geocoded location information to the data you want to filter. For example, if you want to filter a list of stores by the state in which the mobile device is located, you can provide a location mapping attribute that contains separate attribute forms for state location information as returned by Google, and information (such as the store name and store address) for each store. The location mapping attribute must store location information in the same format that Google uses to provide the location of the user.

The attribute that provides the list of attribute elements that are filtered and displayed by the Geo Location prompt, also called the display attribute, does not have to be the same as the location mapping attribute. For example, the Customer State is both the display attribute and the location mapping attribute. When the prompt is displayed on a mobile device, the list of prompt answers is filtered to display the current state, as shown in the image below on the left. Instead, if the display attribute is the Store attribute, and the location mapping attribute is Customer State, the list of prompt answers is filtered to display the stores in the current state, as shown in the image below on the right. Users can select stores from the list for which to display data.

Example of an Attribute Element prompt displaying the current state Example of an Attribute Element prompt displaying a list of stores

For general information about prompts, see About Prompts. For more information on prompts for mobile devices, including the Geo Location prompt, see Creating Prompts for Mobile Devices.

The procedures below list steps to create a Value prompt and an Attribute Element prompt that use the mobile device's geographic location. If you create a Value prompt, you will create a total of two Value prompts, one to provide latitude and one to provide longitude.

To create a Value prompt that uses the mobile device's geographic location

DHTML must be enabled. See How to Enable DHTML in MicroStrategy Web.

  1. Click Create on any page, point to New Prompt, and select Value Prompt.
  2. On the Definition tab, select the Numeric prompt option.
  3. On the General tab, specify a title for the prompt in the Title field.
  4. To require users to answer the prompt before running the report, select the Prompt answer is required checkbox.
  5. To set the maximum and minimum values that can be entered by the user, select the Minimum value and Maximum value checkboxes and type a value in the respective fields. You can specify a minimum value even if you do not specify a maximum value.

To specify the layout and display style of the prompt

  1. On the Style tab, from the Display style drop-down list, select Geo Location.
  2. To specify whether the mobile device will automatically provide its latitude or longitude to answer the prompt, select the Latitude or Longitude option. You will create a total of two Value prompts, one to specify latitude and one to specify longitude.

To save the prompt

  1. To save the prompt, select Save As. The Save As dialog box opens. Specify a name, description, and the location in which to save the prompt and click OK.
  2. Repeat the steps above to create a total of two prompts, one for the mobile device's longitude and one for the latitude.

You can use an Attribute Element prompt to search for elements in a list using the current location of the mobile device. Users can then select an attribute element from the filtered results.

To create an Attribute Element prompt that uses the mobile device's geographic location

  1. On the home page, click New Prompt New Prompt icon.

    If you are on a folder page, you can click Create on the icon bar on the left, and then click New Prompt.

  2. Click Attribute Element List.

To determine the attribute whose elements the user is able to choose from

On the Definition tab, click Select Attribute. Select the display attribute whose elements will be presented as answers in the prompt and click OK. Users select their filter criteria from a list of these attribute elements.

To define the specific elements the user is able to choose from

  1. Choose one of the following options:

    To display all of the attribute's elements to the user when they are answering the prompt, select List all elements (no restriction).

    To create a list of attribute elements from which users can choose, select Use a predefined list of elements. Click Add, select the elements, then click OK. To remove an object, highlight it and click Remove. To remove all items, click Clear.

    To reduce the number of attribute elements displayed to the user, select Use a filter to reduce the number of elements. This option is useful for attributes with a large number of elements, such as Customer or Employee. You can select a filter that returns a specific set of customers, for example, the top 100 customers this month. Browse to and select the filter.

  2. On the General tab, specify a title and description for the prompt in the Title and Instructions fields.
  3. To require users to answer the prompt before running the report, specify whether the prompt requires an answer. Select the Prompt answer is required checkbox.
  4. Set the minimum and maximum number of prompt answers allowed, if desired. Enter these numbers in the Minimum number of answers and Maximum number of answers fields. You can specify a minimum number even if you do not specify a maximum number.

To specify the layout and display style of the prompt

  1. On the Style tab, from the Display style drop-down list, select Geo Location.
  2. From the Select location mapping level drop-down list, select the level at which you want to return the location of the mobile device when the user answers the prompt. For example, if you select State and the user is located at an address in Boston, Massachusetts, the location of the mobile device will be returned for the state of Massachusetts.

    The levels available are determined automatically by Google.

  3. To select the location mapping attribute to use to filter the element list, click Select Attribute. Browse to and select the attribute, then click OK.

    The location mapping attribute must map the location of the mobile device as returned by Google to the data you want to filter. This location data must be at the level selected in the Select location mapping level drop-down list. For example, if you want to filter a list of stores by the state in which the mobile device is located, you can select State as the location mapping level and provide a location mapping attribute that contains separate attribute forms for state location information as returned by Google, and information (such as the store name and store address) for each store.

    The location mapping attribute must store location information in the same format that Google uses to provide the location of the user. For example, if the mobile device is located in Boston, Massachusetts and Google returns Massachusetts, the location mapping attribute must store the state location as Massachusetts and not MA or Mass.

  4. Click Save.

Related Topics

Value Prompt

Attribute Element List Prompt

Introduction to Prompts for Mobile Devices

Creating Prompts for Mobile Devices