Page 1 of 1
how to get user id from string
Posted: Fri Feb 04, 2011 2:05 pm
by Legemza
Hi,
when i use TM1USER() function in TI process, i get CAMID("CognosExpress:username") as output. how can i get only username from this string?
thanks
Re: how to get user id from string
Posted: Fri Feb 04, 2011 6:12 pm
by Alan Kirk
Legemza wrote:Hi,
when i use TM1USER() function in TI process, i get CAMID("CognosExpress:username") as output. how can i get only username from this string?
thanks
If that's the literal string that you're getting, use the Scan() function to find the location of the colon (:) character, and the Subst() function to split out the part beyond that character.
Re: how to get user id from string
Posted: Fri Feb 04, 2011 10:59 pm
by lotsaram
You might also find that you get a more sensible output by calling the }TM1_DefaultDisplayValue alias value
i.e.
sUser = AttrS('}Clients', TM1User(), '}TM1_DefaultDisplayValue');