Cognos TM1 Date and Time Rules Functions:

  • DATE
  • DATES
  • DAY
  • DAYNO
  • MONTH
  • NOW
  • TIME
  • TIMST
  • TIMVL
  • TODAY
  • YEAR

DATE:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes. DATE returns the date string in 'yy-mm-dd' or 'yyyy-mm-dd' format for a given serial number.
Syntax:
DATE(SerialNumber, ReturnFourDigitYear)


Arguments:
ArgumentDescription
SerialNumberA date expressed in serial format.
ReturnFourDigitYearAn optional Boolean argument that determines whether the DATE function returns a string using two- or four-digit notation for the year.
If ReturnFourDigitYear is true, the function returns date falling within the range of Jan. 1, 1960 and Dec. 31, 9999, using four-digit notation for the year. Serial date 0 corresponds to Jan. 1, 1960 and serial date 2936549 corresponds to Dec. 31, 9999.
If ReturnFourDigitYear is false, or if this optional argument is omitted from the DATE function, the function returns a date falling within the range Jan. 1, 1960 and Dec. 31, 2059, using two-digit notation for the year. Serial date 0 corresponds to Jan 1, 1960 and serial date 36524 corresponds to Dec. 31, 2059.
If ReturnFourDigitYear is false or is omitted and you specify a serial date greater than 36524, the serial date used by the function is determined by the formula n - 36525. For example, if you specify a serial date of 36530, then 36530 - 36525 = 5. In this case, DATE uses 5 as the serial date and returns the date Jan. 6, 1960.


Example:
DATE(13947) returns '98-03-09'.
DATE(13947, 1) returns '1998-03-09'.

DATES:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes. DATES returns a date string, in the form 'yy-mm-dd' or 'yyyy-mm-dd', corresponding to a given year, month, and day.
Syntax:
DATES(year, month, day)
Example:
DATES(98, 2, 10) returns '98-02-10'.
DATES(1998, 2, 10) returns '1998-02-10'.

DAY:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
DAY returns a numeric value for the day in a given date string.
Syntax:
DAY(DateString)
Example: DAY('02-05-25') returns 25.

DAYNO:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes. DAYNO returns the serial date number corresponding to a given date string.
Note: DAYNO can return serial dates only for date strings between 1960-01-01 and 2059-12-31.
Syntax:
DAYNO('DateString')
Example:
DAYNO('98-03-09') returns 13947.

MONTH:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
MONTH returns a numeric value for the month in a given date string.
Syntax:
MONTH(date)
Example:
MONTH('02-05-25') returns 5.

NOW:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes. NOW returns the current date/time value in serial number format.
Syntax:
NOW

Arguments:
None.
Example:
NOW returns the current date/time value in serial number format.

TIME:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
TIME returns a string, in HH:MM format, representing the system time on the TM1 server.
Syntax:
TIME

Arguments:
None.

Example:
Given a system time of 9:33 AM, TIME returns the string '09:33'.
Given a system time of 9:33 PM, TIME returns the string '21:33'.

TIMST:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
TIMST returns a formatted date/time string.
Syntax:
TIMST(datetime, format, ExtendedYears)

Example:
TIMST(366.0000, '\M \D, \Y') returns 'JAN 1, 1961'.
TIMST(366.5000, '\H\p \imin\ssec') returns '12p.m. 00min00sec'.
TIMST(366.1000, 'On \M \D, \Y at \H\p \imin\ssec') returns 'On JAN 1, 1961 at 2a.m. 24min00sec'.
TIMST(11111.1100, 'On \M \D, \Y at \H\p \imin\ssec') returns 'On JUN 3,1990 at 2a.m. 38min24sec'.

TIMVL:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
TIMVL returns the numeric value of a component (year, month, etc.) of a date/time value.
Syntax:
TIMVL(datetime, type, ExtendedYears)

Example:
TIMVL(11111.1100, 'Y') returns 1990.
TIMVL(11111.1100, 'H') returns 2.

TODAY:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
TODAY returns the current date in yy-mm-dd format.
Syntax:
TODAY(ReturnFourDigitYear)

YEAR:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
YEAR returns a numeric value for the year in a given date string.
Syntax:
YEAR(date)

Example:
YEAR('02-05-25') returns 2.


Read this aritcle completely...

Cognos TM1 Cube Data Rules Functions:

  1. DB
  2. ISLEAF
  3. UNDEF
  4. UNDEFVALS

DB:
This is a TM1 rules function, valid in TM1 rules only. Use of this function in a TurboIntegrator process will cause an error.
DB returns a value from a cube in a TM1 database. DB returns a numeric value if used in a numeric expression and a string value if used in a string expression.
Syntax:
DB(cube, e1, e2, [...e256])

Arguments:
ArgumentsDescription
cubeThe name of the cube from which to retrieve the value.
e1,...enDimension element names that define the intersection containing the value to be retrieved. e1,...en Arguments e1 through en are sequence-sensitive. e1 must be an element from the first dimension of the cube, e2 must be an element from the second dimension, and so on.

Example:
DB('Budget', 'California', '15" Flat Panel Monitors', 'Net Sales', 'January')
In the above example, Budget is the cube name, and the function returns the value at the intersection of California, 15" Flat Panel Monitors, Net Sales, and January.

ISLEAF:
This is a TM1 rules function, valid only in TM1 rules.
ISLEAF returns 1 if a specified cell is a leaf cell (identified solely by leaf/simple elements). If the specified cell is identified by any consolidated elements, the function returns 0.
The ISLEAF function cannot be used in TurboIntegrator processes. The presence of this function in a process will prevent the process from compiling.
Syntax:
ISLEAF
Arguments:
None

Example:
You can use ISLEAF in an IF statement to test if a current cell is a leaf cell.
For example, []=IF((ISLEAF=1),TrueStatement, FalseStatement);
executes the TrueStatement if the current cell is a leaf cell, otherwise it executes the FalseStatement.

UNDEF:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
UNDEF returns the undefined value. This function can be used to prevent datafrom being stored in a cube based on a logical test.
Syntax:
UNDEF
Arguments: None

Example:
UNDEF returns the undefined value.

UNDEFVALS:
This is a TM1 rules function, valid in both TM1 rules and TurboIntegrator processes.
UNDEFVALS allows users to distinguish between data cells that are empty and cells that actually contain a zero. When a rule includes an UNDEFVALS statement, cells containing zeros display the value zero, but empty cells appear blank. This function can also be used to prevent data from being stored in a cube based on a logical test. When used, UNDEFVALS must be the first statement in a rule without a SKIPCHECK statement.
If a rule includes a SKIPCHECK statement, the UNDEFVALS statement must be the second statement in the rule.

Note: When UNDEFVALS is used to distinguish between empty cells and those containing the value 0, cells containing the value 0 remain visible when zero suppression is applied to a view.
Syntax:
UNDEFVALS
Arguments:
None.

Example:
When a rule includes an UNDEFVALS statement, cells containing zeros display the value zero, but empty cells appear blank.


Read this aritcle completely...

This post contains a complete list of all Cognos TM1 rules functions. You can use any of these functions when writing TM1 rules. You can also incorporate all rules functions, with the exception of the STET and ISLEAF functions, in TurboIntegrator processes.
Arithmetic Operators in TM1 Rules:
The following mathematical operators can be used when constructing TM1 rules.

OperatorMeaning
+ (Plus Sign)Addition
- (Minus Sign)Substraction
* (asterisk)Multiplication
/ (forward slash)DivisionDivision by zero using this operator returns an undefined value.
\ (back slash)DivisionDivision by zero using this operator returns zero.
^ (caret/circumflex)Exponentiation

Comparison Operators in TM1 Rules:
You can use the following comparison operators to compare values in the formula portion of a rule calculation statement.
OperatorMeaning
>Greater than
<Less than
>=Greater than or equal to
<=Less than or equal to
=Equal to
<>Not equal to

Note: To compare two string values, insert the @ symbol before the comparison operator, as in the following example:
IF ('A' @= 'B',0,1) yields the number 1

Logical Operators in TM1 Rules:
You can combine expressions in a rules calculation statement using logical operators.
OperatorMeaningExample
& (Ampersand) AND(Value1 > 5) & (Value1 < 10) Returns TRUE if the value is greater than 5 and less than 10.
% (Percentage sign) OR(Value1 > 10) % (Value1 < 5) Returns TRUE if the value is greater than 10 or less than 5.
` (Tilde) NOT~(Value1 > 5) Equivalent to (Value1 <= 5)



Read this aritcle completely...

Blog Widget by LinkWithin