Restricting rows in datasets based on SQL query

In Cloudera Data Visualization, you can easily restrict the table rows in the dataset by changing the SQL definition of that dataset. SQL-defined datasets make it easy to limit their content to specific rows.

  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
  3. In the Refresh dataset table column information modal window, click Close.
    Columns 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
  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