Question & Answer
Question
How can the TM1 Applications job history be cleared. Clearing the TM1 Applications job history may be performned if the }tp_application_jobs cube grows to large as a result of constant application maintance such as changes in rights assignments.
Answer
Create a new Ti process with the following code in the prolog section. No data source is required.
dim = '}tp_jobs';
WHILE ( DIMSIZ ( dim ) > 0 );
index = DIMSIZ ( dim );
elem = DIMNM ( dim, index );
ExecuteProcess( '}tp_job_delete', 'pExecutionId', '', 'pJobId', elem, 'pControl', 'Y' );
END;
When run this Ti process will clear all job history (all data in the }tp_application_jobs cube and elements in the }tp_jobs dimension) for all deployed applications in the TM1 model.
Note that this will clear the entire }tp_application_jobs cube. This Ti code can be extended to only clear job history older than a specific date. For example:
##Assume pDate is a parameter for the cut off date in the format of number of seconds since Jan 1st, 1970. For example: Fri, 22 Jul 2016 10:00:00 GMT would be 1469181600 seconds.
dim = '}tp_jobs';
skip = 0;
WHILE ( DIMSIZ ( dim ) - skip > 0 );
index = DIMSIZ ( dim ) - skip;
elem = DIMNM ( dim, index );
IF (StringToNumber(CellGetS('}tp_application_jobs', elem, 'EndDate')) < pDate );
ExecuteProcess( '}tp_job_delete', 'pExecutionId', '', 'pJobId', elem, 'pControl', 'Y' );
ELSE;
skip = skip + 1;
ENDIF;
END;
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21987687