How find current users name?

Product:

Planning Analytics 2.0.9.19

Issue:

Want the user name, running the TM1 TI process to be in the filename – how?

Solution:

There are many ways to do this, check internet and tm1py.

But this is a suggestion, when you use CAMID with Cognos Analytics:

# -- get the user
sUserRAW = TM1User() ;

IF ( SCAN ('R*S' ,sUserRAW ) <> 0 ) ;
sUser = 'Scheduled' ;
ELSE;
# -- get the alias 
sUserALIAS = ATTRS( '}Clients' , sUserRaw , '}TM1_DefaultDisplayValue') ;
# -- find the name part of the domain/name 
sUserBREAK = SCAN ( '/' , sUserALIAS ) ;
# -- SUBST(string, beginning, length) 
sUser = SUBST( sUserALIAS, sUserBREAK +1, LONG (sUserALIAS) - ( sUserBREAK ) ) ;
ENDIF;

sFileName = 'Data.' | sUser | '.' | TIMST( NOW(), '\Y\m\d.\h\i', 1) | '.zip';

 

 

More Information:

https://everanalytics.wordpress.com/2017/08/10/tm1_alias_attributes/ 

https://www.ibm.com/docs/en/planning-analytics/2.1.0?topic=mtf-tm1user