Syntax of Functions
Functions used in a text type target dimension:
|
Function |
Description |
Example |
|---|---|---|
|
CLEAN (text; character) |
Deletes the specified character in the text string. |
CLEAN("moment" ;'m') = "oent" |
|
COMPLETE (text; character; total length of code generated) |
Completes a string using the character indicated as many times as necessary until the code reaches the indicated total length. |
COMPLETE("RUB1" ;'0' ;8)=RUB10000 |
|
CONCAT (text1;text2;...) |
Gathers together several character strings to create a single string. Text1;text2;... represents the text elements to be grouped together in a single string. |
CONCAT("Total ";"Value") = "Total Value" |
|
FIXED (number; decimals; no_separator) |
Rounds a number up or down to the specified number of decimal places and returns the result in text form.
If no value is indicated for "no_separator", the text returned will include spaces. |
FIXED(1234.567; 1)="1 234.6" |
|
LEFT (text; nb_characters) |
Returns the indicated number of characters starting from the left of the text string. Nb_characters must be greater than or equal to zero. If nb_characters is greater than the text length, LEFT returns the whole text. |
LEFT("Sales Price"; 4)="Sale" |
|
MID (text; no_start; no_car) |
Returns a given number of characters extracted from a text string starting from the point specified.
Text: represents the text string containing the characters to be extracted.
|
MID("chapter" ; 3 ; 2)="ap" |
|
REPLACE (old_text; no_start; no_char; new_text) |
Replaces one text string with another.
|
REPLACE("1990"; 3; 2; "91")="1991" |
|
REPT (text; no_times) |
Repeats a text a certain number of times.
|
REPT("*-"; 3) = "*-*-*-" |
|
RIGHT (text; nb_characters) |
Returns the indicated number of characters starting from the far right-side of the text string. Nb_characters must be greater than or equal to zero. If nb_characters is greater than the length of the text string, the RIGHT function will return the whole text. |
RIGHT("Sales price"; 5)="price" |
|
SUBSTITUTE (text; old_text; new_text; no_position) |
Replaces the argument in old_text with new_text in a text string.
|
SUBSTITUTE("Sales"; "Sales"; "Cost") = "Cost" |
|
TRIM (text) |
Deletes all spaces between text except spaces between words. |
TRIM(Turnover...first....quarter ") = " Turnover first quarter " |
Functions used in a numerical target dimension:
|
Function |
Description |
Example |
|---|---|---|
|
+ |
Add |
123+123=246 |
|
- |
Subtract |
123-122=1 |
|
* |
Multiply |
12*11=132 |
|
/ |
Divide |
144/12=12 |
|
ABS (number) |
Returns the absolute value of a number. |
ABS(2)=2 ABS(-2)=2 |
|
LEN (text) |
Gives the length of a string of characters. Spaces are counted as characters. |
LEN("string")=6 |
|
VALUE (text) |
Converts a string of characters representing a number into a number. The number must be represented without a thousand separator and with . as the decimal separator. |
VALUE("3352.14") = 3352.14 |