Using single quotes in variables


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.


You have 2 choices:

  1. Double the single quote:
    MyVariable = 'Standard & Poor''s';
  2. 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.');


Section contents

About Wim

Wim Gielis is a Business Intelligence consultant and Excel expert

Other links