Newer Version Available

This content describes an older version of this product. View Latest

mv_to_string() (Beta)

Converts multi-value fields to string fields.

Syntax

As a beta feature, mv_to_string() is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature. You can provide feedback and suggestions for this feature in the Trailblazer Community.

To enable this feature, contact Salesforce Customer Support.

Note

mv_to_string(multi-value_column_name, delimeter)
multi-value_column_name
Name of the multi-value field to be converted to a string.
delimiter
Optional. The characters used to delimit values in the converted string. Maximum length is 2 characters.

Usage

Returns an alphabetically-sorted, delimited string representation of a multi-value field. The default delimiter is a comma followed by a space (, ).

mv_to_string() applies to non-grouped streams only. You can run filtering or grouping on a multi-value field post-projection.

Example

This query returns values of the Accounts Team as a string delimited by a comma and space, in alphabetical order.
1q = load "Accounts";
2q = foreach q generate
3    'Account' as 'Account';
4    mv_to_string('Account_Team') as 'Account Team';
Account Account Team
Acme Fred Williamson, Hank Chen, Sarah Vasquez
DTC Electronics Brian Alison, Tessa McNaley
Salesforce Nadia Smith

Example

This query returns the values of Accounts Team as a string delimited by two semicolons (;;) in alphabetical order.
1q = load "Accounts";
2q = foreach q generate
3    'Account' as 'Account';
4    mv_to_string('Account_Team', ";;") as 'Account Team';
Account Account Team
Acme Fred Williamson;;Hank Chen;;Sarah Vasquez
DTC Electronics Brian Alison;;Tessa McNaley
Salesforce Nadia Smith

In order for mv_to_string() to display all values of a multi-value field, dataset registration requires extra indexing. That indexing can slow registration down. If this is a concern, you can disable this feature in Setup. If you run mv_to_string() with the indexing turned off, the function returns the first value in the first field only.

  1. Enter Analytics in the Quick Find box.
  2. Select Settings from the list of Analytics options.
  3. In Settings, click the checkbox for Exclude multi-value dimension values in Einstein Analytics.

Note