COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: dipstm on 26 Jan 2009 05:23:47 PM

Title: Filtering query by logged in user(using macros)
Post by: dipstm on 26 Jan 2009 05:23:47 PM
Hi All,
I have a query(Query1) in report studio. In tht query i have fileds like user_id,user_login_name,etc. I want to filter tht query for the user who is currently logged on.
Is it possible to achieve this ?
Can anyone plz let me knw the exact syntax of doing this.

Thanx in advance.

Title: Re: Filtering query by logged in user(using macros)
Post by: masilabalu on 28 Jan 2009 03:39:16 AM
Hi,

Use this....

#sq($account.defaultName)#

thanks,
Balu.

Title: Re: Filtering query by logged in user(using macros)
Post by: hung2k9 on 05 Oct 2010 01:46:51 PM
Hi,

How can I pass this #sq($account.defaultName)# to be the default selection of a value prompt or a parameter for the prompt?

I have a report which based on a value prompt (which is list of user names) and I want the login user name to be the default selection, so that when he runs the report, it won't ask for any name, just get the current login username and render the report.

I can not put this macro into the default selection field of this value prompt.

Thanks
Hung