Create More Complex Dataflow Filters with SAQL

Filter nodes in your dataflows now support Salesforce Analytics Query Language (SAQL), so you can create more complex filters to get just the data that you need in your datasets. SAQL gives you a wider range of operators. For example, you can filter on an array of values, on part matches, and on relative dates.

Where: This feature applies to Einstein Analytics in Lightning Experience and Salesforce Classic. Einstein Analytics is available in Developer Edition and for an extra cost in Enterprise, Performance, and Unlimited Editions.

Who: To create or edit a dataflow, you must have the Edit Analytics Dataflows permission.

How: When you add a filter node in the dataflow editor, SAQL is selected by default. Imagine that you want to create a dataset of large opportunities closing soon to identify where you might need executive sponsorship. You add this filter using the in operator to include opportunities at the last two stages of your sales cycle. You also use current month as a relative date to include opportunities closing this month.Screenshot of filter node in dataflow editor with athe SAQL section highlighted

If you’re adding the filter node in the dataflow JSON, use the saqlFilter parameter. Escape the double quotes inside the filter with \.
"filterOpps": {
    "action": "filter",
    "parameters": {
      "source": "getOpps",
      "saqlFilter": "(StageName in [\"Proposal/Price Quote\", \"Negotiation/Review\"]
      || date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in [\"current month\" .. \"current month\"]) 
      && Amount >= 100000"