COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: sharon on 02 Jun 2014 02:39:25 AM

Title: Dynamic default selection in value prompt
Post by: sharon on 02 Jun 2014 02:39:25 AM
Hi,

I have one value prompt as study_number( single selection ) in prompt page. and I have to display default selection of study_number based on user login. I am using cognos 10.2. Please give me your suggestions.

Thanks,
Sharon.
Title: Re: Dynamic default selection in value prompt
Post by: BigChris on 02 Jun 2014 09:42:34 AM
Have you got a table that maps the default study number to the user login?
Title: Re: Dynamic default selection in value prompt
Post by: riteshsinghrathod on 03 Jun 2014 02:50:59 AM
Hi Can you confirm if ur doing it in production or development and if u have access to Frame work manager
Title: Re: Dynamic default selection in value prompt
Post by: riteshsinghrathod on 03 Jun 2014 04:39:54 AM
Hi Sharon,

To get this done the way what I could think of, is by using session parameters like (#sq($account.defaultName)#) in valueprompt query's filter in report, which will limit the values of prompt to that user only.

or the other way would be to go to framework manager. create a new query subject whose query pulls study_number  based on the session parameter.

select study_number from XXXX where empid =(select empid from employee where employeename= #sq(($account.firstName)+($account.lastName)#)  (U might need to  verify the syntax, but logic will be like this)

In either of the ways u have to figure out a way to map session parameter to your study number.
Title: Re: Dynamic default selection in value prompt
Post by: sharon on 06 Jun 2014 02:58:51 AM
Hi,

Yes I have a table for user role and study no. I can get the user role using session parameter and also appropriate study no. but I want to display that study no as defaut when i  run the prompt page.