Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
starts_with()
Syntax
starts_with(string, prefix)
Usage
Returns true if string starts with prefix, otherwise returns false. String comparison is case-sensitive. If any of the parameters are null, then the function returns null. If prefix is an empty string, then the function returns null.
Example
Suppose that you want to count the opportunities where the owner role starts with "Sales". Use starts_with() in a case statement.
1q = load "DTC_Opportunity";
2
3-- Select rows where the owner roles starts with "Sales"
4q = foreach q generate count() as 'count', (case
5 when starts_with('Owner_Role', "Sales") then 'Owner_Role'
6end) as 'Owner_Role';
7
8q = group q by 'Owner_Role';
9q = foreach q generate count() as 'count', 'Owner_Role' as 'Owner_Role';The resulting chart shows the number of opportunities where the owner role starts with "Sales", grouped by owner role.
