Using single quotes in variables
- Feb. 14, 2010
Introduction
At times, you need to use a single quote (’) in a variable or a TM1 rule. For instance, you want to use the company name Standard & Poor’s in a variable.
Options
You have 2 choices:
- Double the single quote:
MyVariable = 'Standard & Poor''s'; - Break up the string into parts:
MyVariable = 'Standard & Poor' | CHAR(39) | 's';
In the second solution, you use the CHAR function, since this will not work: MyVariable = 'Standard & Poor' | ''' | 's';
For a custom error message in TM1, consider something like: ItemReject('The Company mapping ''' | vCompany | ''' is invalid for Company ''' | Company | ''' and Branch ''' | vBranch | '''. Please investigate.');