Skip to content

Instantly share code, notes, and snippets.

@lyndsysimon
Last active March 21, 2017 15:44
Show Gist options
  • Save lyndsysimon/e29652ad99563049b5bf98e7e59f43c2 to your computer and use it in GitHub Desktop.
Save lyndsysimon/e29652ad99563049b5bf98e7e59f43c2 to your computer and use it in GitHub Desktop.
Filter Negation using the Domo Analyzer

Problem

Given a list of users and roles, display all users who do not have the admin role.

Existing Behavior

When an aggregation is performed in the card, it happens after the filter is applied. As a result, the row (1, admin) is filtered out, but the row (1, user) is not.

Needed Behavior

Ideally, we'd like a way to apply filters across a join relationship at the page level. User objects may have multiple roles concurrently, and to my knowledge there is no straightforward way to preserve that one-to-many relationship until end-user-defined filters are applied, but before aggregation occurs.

Datasource

User ID Role
1 user
1 admin
2 user

Table Card

Column Aggregation
User ID None
Record Count COUNT of User ID

Analyzer

Role does not contain admin

To create this filter:

  1. click "New Filter"
  2. click "Role"
  3. check "admin"
  4. change the operator dropdown in the top right to "Not In"
  5. click "Apply"

Result

User ID Record Count
1 1
2 1

Desired Result

User ID Record Count
2 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment