Create cleaner queries with better performance and stop worrying about filter item limitations. Generate semi-join or anti-join results from different datasets in a single SAQL query using the join statement with a join_type specifier.
Where: This change applies to CRM Analytics in Lightning Experience and Salesforce Classic. CRM Analytics is available in Developer Edition and for an extra cost in Enterprise, Performance, and Unlimited editions.
How: Use the CRM Analytics SAQL editor to create your queries.
This example uses a semi-join statement to query for accounts with more than 10 opportunities.
account = load \"accounts\";
opp = load \"opportunities\";
opp = group opp by accountId;
opp = foreach opp generate accountId, count() as count;
opp = filter opp by count > 10;
q = join account by (id) semi, opp by (accountId)
This examples uses an anti-join statement to query for accounts with no opportunities.
account = load \"accounts\";
opp = load \"opportunities\";
q = join account by (id) anti, opp by (accountId)
Create More Efficient Queries with Semi-Joins and Anti-Joins (Generally Available) (salesforce.com)