Contains
Returns a subset of elements in a list based on a string search of captions using a 'contains' operation.
- Returned Output: List
- Library: PQL \ Semantic \ String
- Version: 2018.00.000
- Compatibility: Pyramid Query Language (PQL) data sources
Syntax
* Click on the function's arguments above for more details on the input values.
Comments
- List parameter should be a list or set of elements from an existing hierarchy in the model.
- The search text string needs to be contained in quotation marks.
- For details on how to employ and use this function see the semantic calculation overview.
Different Function types
- To use a simple string manipulation operations, use the Common library function.
Also see StartsWith, Equals and EndsWith.
Examples
This example searches for strings containing 'ne', and returns all three states - New York, New Jersey, and Maine:
Contains( {[Customer].[state].[New York], [Customer].[state].[New Jersey], [Customer].[state].[Maine]}, 'ne' )
This method searches for strings containing 'ew', and returns New York and New Jersey:
Contains( {[Customer].[state].[New York], [Customer].[state].[New Jersey], [Customer].[state].[Maine]}, 'ew' )
This method searches for strings containing 'i', and returns Maine:
Contains( {[Customer].[state].[New York], [Customer].[state].[New Jersey], [Customer].[state].[Maine]}, 'i' )