Tutorial: Create a prepared Amazon QuickSight dataset - Amazon QuickSight
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Tutorial: Create a prepared Amazon QuickSight dataset

Use the following procedure to prepare the Marketing dataset and create an analysis. If you don't see the Web and Social Media Analytics sample data already in Amazon QuickSight, you can download it: web-and-social-analytics.csv.zip.

To prepare the Marketing dataset and create an analysis
  1. On the Amazon QuickSight start page, choose Datasets at left.

    Navigation menu with Datasets option highlighted and analysis cards displayed on the right.
  2. On the Datasets page, choose New dataset.

    Datasets page interface with a blue "New dataset" button in the top right corner.
  3. In the FROM EXISTING DATA SOURCES section of the Create a Data Set page, choose the Web and Social Media Analytics Amazon S3 data source and then choose Edit dataset.

    Amazon QuickSight opens the data preparation page.

  4. For Dataset Name, enter Marketing Sample to replace Web and Social Media Analytics for the dataset name.

    Dataset name field in QuickSight interface with "Web and Social Media Analytics" entered.
  5. Exclude some fields from the dataset.

    In the Fields pane, choose the field menu for the Twitter followers cumulative and Mailing list cumulative fields, and then choose Exclude field.To select more than one field at a time, press the Ctrl key while you select (Command key on Mac).

    Fields pane showing options to exclude fields, with Twitter and Mailing list fields highlighted.
  6. Rename a field.

    In the Dataset preview pane, scroll to the Website Pageviews field and choose the edit icon.

    Dataset preview pane showing columns for W, Twitter, and Website Pageviews with edit icon highlighted.

    In the Edit field page that opens, for Name, enter Website page views, and then choose Apply.

  7. Add a calculated field that substitutes a text string for any 0-length string value in the Events field:

    1. On the data preparation page, scroll to the top of the Fields pane, and then choose Add calculated field.

      Fields pane with "Add calculated field" button highlighted at the top.
    2. In the Add calculated field page that opens, for Add name, enter populated_event.

    3. In the Functions pane at right, double-click the ifelse function from the list of functions. This adds the function to the calculated field formula.

      List of functions in the Functions pane, with "ifelse" highlighted.
    4. Expand the Field list pane by choosing the drop-down arrow, and then double-click the Events field. This adds the field to the calculated field formula.

      Fields and Functions sections with a search bar and "extract" function visible.
    5. In formula editor, enter the following additional functions and parameters required, in bold in the following: ifelse(strlen({Events})=0, 'Unknown', {Events}).

      The final formula should be as follows: ifelse(strlen({Events})=0, 'Unknown', {Events}).

      Formula for populated_event using ifelse function with Events variable and 'Unknown' default.
    6. Choose Save.

      The new calculated field is created, and appears at the top of the Fields pane.

      Fields pane showing "populated_event" checkbox selected and options to add calculated fields or augment with SageMaker AI.
  8. Choose Save.

    Buttons for Save & visualize, Save, Cancel, and Add data in a user interface.

Next steps

Create an analysis by using the procedure in Tutorial: Create an Amazon QuickSight analysis.