Restricting Rows in Datasets Based on SQL Query

In Arcadia Data, you can easily restrict the rows of a table in the dataset by changing the SQL definition of that dataset.

In some cases, you may find it useful to have the dataset contain only regional information, such as all data that effects the Southwestern United States (Arizona, New Mexico, California, Nevada, Colorado, and Utah). SQL-defined datasets make it easy to limit their content to the specific data rows that contain that information.

  1. Switch to Dataset Detail interface, and edit SQL text window by applying the following statement:

    select county, stname, ctyname, tot_pop, tot_male, tot_female from main.us_counties
      where stname in ('Arizona','New Mexico', 'California','Nevada','Colorado','Utah')
  2. Click Save.

    Restricting Rows in Dataset based on SQL Query
    Restricting Rows in Dataset Based on SQL Query
  3. In the Refresh dataset table column information modal window, click Close.

    Rows Updated
  4. Switch back to the Data Model interface, click Show Data, and notice that the dataset is limited to the states specified in the SQL statement.

    Dataset based on SQL Query, with Restricted Rows
    Dataset based on SQL Query, with Restricted Rows
  5. If you were to test it by creating a simple map visual on the dataset, it would look something like this:

    Visual on a dataset with restricted rows
    Visual on a dataset with restricted rows