# developers

& AND
% OR
~ NOT

## Strings operators

| concatenate
@= string1 equals string2
@<> string1 differs from string2

inserting '&' in strings:
ItemReject('This & That'); will return 'This _That'
ItemReject('This && That'); will return 'This & That'

## TM1 lint

alias.pl is a very basic lint tool whose task is to flag "dangerous" TM1 rules.
For now it is only checking for aliases in rules.

Indeed, if an alias is changed or deleted, any rule based on that alias will stop working without any warning from the system. The values will remain in place until the cube or its rules gets reloaded but you will only get a "silent" warning in the messages log after reloading the cube.

## The fallacy of blb files

TM1 system files with the blb extension, incorrectly referenced as "cube formatting" files (admin guide p.35) are actually "rule formatting" files for the "standard" rules editor (prior to 9.1).
The rules editor actually displays the contents of the .blb if there is one, otherwise it defaults to the .rux.
Unfortunately things can go wrong, and the .blb file gets desynchronised from the actual .rux or just go blank.

## Silent failures

TM1 processes will not complain when their input source is empty.
So although the "process successful" or "chore successful" message will popup, your cube will remain desperately empty.
In order to solve that silent bug (or rather "feature" in IBM's eyes), you will need to add specific code to your TI processes to test against empty sources.
Here follows:

.initialise counter
PROLOG TAB

SLineCount = 0;

#****GENERATED STATEMENTS START****


.increment counter
DATA TAB

## Send email/attachments

It is possible to send email alerts or reports as attachments from Turbo Integrator. This can be achieved by executing a VB script.

1. Save the attached VB script on your TM1 server
2. Create a TI process
3. In the Epilog tab, add the following code:

S_Run='cmd /c D:\path\to\SendMail.vbs smtp.mycompany.com 25 tm1@mycompany.com me@mycompany.com "Today report" "check it out" E:\TM1Reports\todaysreport.xls'
ExecuteCommand(S_Run,0);

## Running chores on a specific day of the month

Scheduling chores in TM1 can be frustrating as it does not offer to run on specific dates or other types of events. The following article explains how to create chores schedules as flexible as you need them to be.

From the Server Explorer

## Rules

Dimension elements containing a single quote character (') require a double quote to be interpreted correctly by the rules engine.
Example: ['department's'] -> ['department''s']

One could use aliases without single quote characters too, however the rule would break if anything were to happen to these aliases. So it is best practice not to use single quote characters in your elements in the first place and if you really need them, then use the double quote in the rules.

## Renaming elements

Renaming elements without activating aliases? Yes we can!
The dimension editor and dimension worksheets cannot rename elements directly, so let me introduce you to SwapAliasWithPrincipalName.

In this example, we will add a padding "0" to an existing set of elements without rebuilding the dimension from scratch.

Before swap:

## Dynamic SQL queries with TI parameters

It is possible to use parameters in the SQL statement of Turbo Integrator to produce dynamic ODBC queries

Here is how to proceed:

## Dynamic formatting

It is possible to preformat dynamic slices by using the Edit Element Formats button in the subset editor. However that formatting is static and will not apply to new elements of a slowly changing dimension. Also it takes a long time to load/save when you try to apply it to more than a few dozen elements.

As an example, we will demonstrate how to dynamically alternate row colors in a TM1 report for a Customer dimension.