Create Lenses that Focus Ask Data for Specific Audiences

Most people don’t need information from an entire data source but instead want data visualizations relevant to their job function, like sales, marketing, or support. To optimize Ask Data for different audiences like these, Tableau authors create separate Ask Data lenses, which query a selected subset of fields. For the selected fields, authors can specify synonyms for field names and values, reflecting terms the lens audience uses in common language (for example, "SF" for "San Francisco"). Lens authors then customize the recommended visualizations that appear below the Ask Data query box, which provide answers to users with a single click.

Note: Ask Data lenses can be created only for data sources published separately to a Tableau site, not data sources embedded in workbooks.

Create or configure a lens page on your Tableau site

On your Tableau site, each lens has a separate page where users can query Ask Data and authors can configure lens fields, synonyms, and suggested questions.

A lens page on a Tableau site

  1. To create a lens page on your Tableau site, go to a data source page, and choose New > Ask Data Lens.

    To configure an existing lens, go to the lens page on your site. (From an Ask Data object in a dashboard, you can click the pop-up menu in the upper corner and choose Go to Lens Page.)

  2. If you're creating a new lens, enter a name, description, and project location, and then click Publish Lens.
  3. At the top of the Fields pane at left, click the pencil icon. Then select the relevant fields for lens users, and click Save.

  4. At left, hover over individual fields, and click the pencil icon to do either of the following:

To address common queries from lens users, you can customize the recommended visualizations that appear below the query box.

  1. Enter a query into the text box, and press Enter or Return.
  2. After the visualization appears, from the pin icon in the toolbar, choose either Pin to Recommended Visualizations or Replace Recommendation.

  3. For a new recommendation, enter a name, and choose the section in which you want it to appear. For a replacement recommendation, choose the existing one you want to overwrite.

Edit section titles and recommendation names, or delete recommendations

  • To edit a section title, click the pencil icon to the right of the title.
  • To change the name of a recommendation, hover over it and click the pencil icon . To delete a recommendation, click the X.

Add an Ask Data lens to a dashboard

On a dashboard, you can add an Ask Data object that lets users query a published data source via a lens on your Tableau site.

  1. While editing a dashboard in Tableau Online, or Tableau Server, drag the Ask Data object to the canvas.

    Note: In Tableau Desktop, you can also drag an Ask Data object to the canvas for placement purposes. But to select a lens, you will need publish to Tableau Online or Tableau Server and edit the object there.

  2. Select a published data source previously connected to the workbook.
  3. To use an existing lens, select it, and click Use Lens. Then skip remaining steps.

    Or, to create a new lens, do one of the following:

    • If there are no lenses for the data source, click Go to Data Source Page.
    • If lenses already exist, click the data source name at the bottom of the dialog.
  4. Complete the steps in Create or configure a lens page on your Tableau site.
  5. After you finish creating the lens, return to the Lens object in your dashboard, and click Refresh. Then select the new lens, and click Use Lens.

Apply a different lens to an Ask Data dashboard object

  1. From the pop-up menu at the top of the object, choose Configure.

  2. Go to Add an Ask Data lens to a dashboard, and repeat steps 2 onward.

Change a lens name, description, or project location

  1. Navigate to the lens page on Tableau Online or Tableau Server.
  2. To the right of the lens name at the top of the page, click the three dots (...), and choose Edit Workbook.
  3. Click Edit Lens Details.

See how people use Ask Data with a lens

For data source owners and lens authors, Ask Data provides a dashboard that reveals the most popular queries and fields, the number of visualization results that users clicked, and other helpful information. Filters let you narrow data down to specific users and time ranges. These stats help you further optimize a lens to increase the success of your users.

Note: If you use Tableau Server, you can access this data in the Tableau Server Repository to create custom dashboards.

  1. In Tableau Server or Tableau Online, navigate to a lens page.
  2. To the left of the Ask Data text box, click the "Ask Data tips" icon.

  3. In the lower-left corner of the tips dialog, click Usage Analytics.

Let users email you questions about a lens (Tableau Online only)

As a lens owner, you can allow users to email you with questions about data structure, expected results, and more. This option is on by default, but you can turn it off using the steps below.

  1. In Tableau Server or Tableau Online, navigate to a lens page.
  2. To the left of the Ask Data text box, click the "i" shown above in See how people use Ask Data with a lens.
  3. At the bottom of the tips dialog, click the eye icon next to "Contact the Lens Author" to enable or disable feedback.

Permissions for publishing and viewing lenses

For Ask Data objects in dashboards, no change to permissions should be required: by default, existing workbook authors can create lenses, and existing dashboard audiences can view them. But for reference, here's a detailed outline of required lens permissions for both dashboards and direct access via a data source page.

To create and publish a lens, a user needs:

  • The Creator or Explorer user role
  • Lens Creation permission for the data source (inherited by default from the Connect permission)
  • Write permission for the parent project to which the lens is published

To access and interact with a published lens, a user needs:

  • The Viewer role or above
  • Connect permission for the data source
  • View permission for the lens

Note: By default, lens permissions like View reflect a project's permissions for workbooks. If Tableau administrators want to change default lens permissions, they can do so either individually for each project, or in bulk using the permissions API.

Thanks for your feedback!