function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andre Largie 1Andre Largie 1 

using an OR statement

Hi,

I'm having a hard time creating a SAQL statement that will allow me to match records that contain one of many string values.  I'm trying to filter on records that contain "scratch" or "cut" in the notes.  Any suggestions?  Thanks in advance.

The following statement won't work for me:

q = load "All_Baby_Salesforce";
q = filter q by 'SAP_Notes_Internal' matches ["scratch" || "cut" ];
q = group q by all;
q = foreach q generate unique('CP_ID') as 'unique_CP_ID';
q = limit q 2000; 
Alain CabonAlain Cabon
Probably already solved but it is always interesting to have a posted solution.

q = load "All_Baby_Salesforce";
q = filter q by 'SAP_Notes_Internal' matches "scratch"   or  'SAP_Notes_Internal'  matches  "cut" ;
q = group q by all;
q = foreach q generate unique('CP_ID') as 'unique_CP_ID';
q = limit q 2000; 

My own test with training datasets:

q = load "case";
q = foreach q generate 'Account.Industry' as 'Account.Industry', 'Account.Name' as 'Account.Name';
q = filter q by 'Account.Name' matches "Duncan" or  'Account.Name' matches "Grant" ;
q = limit q 100;

https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_saql.meta/bi_dev_guide_saql/bi_saql_operators_comparison.htm

User-added image


This studio is free and there are many questions about SAQL on this forum.
 
jisn mosejisn mose
Can I embed this application with my website? I'm working for baby care internet site and I apply this scripts for my website (https://www.topbadythings.com/) .