How to handle names with spaces inside custom expressions in Spotfire

How to handle names with spaces inside custom expressions in Spotfire

book

Article ID: KB0070887

calendar_today

Updated On:

Products Versions
Spotfire Analyst All

Description

Assume an expression with the following type, where a search expression inside a map() function call is done:

 

map("[COLUMN_NAME].$esc($csearch([COLUMN_NAME],"datatype:real and not name:MY COLUMN NAME"))",",")
 
Notice that the column in the search part of the call to map() has spaces in its name. This column name will be treated as separate search terms when Spotfire processes the expression. The expression will therefore be considered invalid, even though this is a legal operation.

Issue/Introduction

How to handle names with spaces inside custom expressions in Spotfire.

Resolution

The solution is to replace all spaces in the column name with underscores "_" when it is used in the call to map(), as this will also be matched to a space if such a match can be made.
 
Modified expression: map("[COLUMN_NAME].$esc($csearch([COLUMN_NAME],"datatype:real and not name:MY_COLUMN_NAME"))",",")