Enhanced Calculated Fields - Search Function
Why is it Useful?
Users can now search for specific bits of text within the data they are analyzing. This allows users to search for specific names, patterns, or phrases to create calculations based on the results.
NOTE: This feature was released in Patch 19.
How Does it Work?
Visualization calculated fields can be created and added to a folder in BI Dashboard Builder by clicking on the down arrow () beside a folder in the Fields pane.
The drop-down lists are used to make selections and the Insert icon () is added to each list to explicitly insert the selected value.
search(<findText>,<withinText>) returns the number of the characters at which a text string is first found, reading left to right. When the text string is not found, it returns 0.
<findText>: The text that you want to find. Regular expressions are supported. For example, a question mark (?) matches any single character; an asterisk (*) matches any sequence of characters.
<withinText>: The text in which you want to search for findText, or a column containing text. withinText can also be an expression returning the text.
Examples:
Total A = switch(search("total", 'folder'[string field]), 0, "Not Total", "Total")
Total B = switch(true, search("sum", 'folder'[string field]) > 0, “Total”, “Not Total”);
Use regex logical or operator | Total C = switch(search("total|sum", 'folder'[string field]), 0, "Not Total", "Total")
NOTE: The search function and text comparisons in BI are case-insensitive.
To learn more about some of the latest features released in this patch, return to Patch 19 Highlights.