COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: gatorfe on 17 Jan 2011 10:23:25 AM

Title: Using Calculated field in Prompt Page
Post by: gatorfe on 17 Jan 2011 10:23:25 AM
Hello, I have a calculation called New Account Number on a report.  The calculation is substring(AccountNo,1,3).  I created a filter on the new calculation field and made it a parameter.  I added a value prompt to the prompt page on this parameter but no values show up for me to select on the prompt page when I run the report.  I checked the calculation after I created it and I was getting the desired data.    How can I use this calculated field in a prompt page?  Thanks in advance for any suggestions!
Title: Re: Using Calculated field in Prompt Page
Post by: MFGF on 17 Jan 2011 11:15:57 AM
Hi,

The values in a value prompt are usually populated by means of a query.  If you select your value prompt, the first thing to check is that it does actually have an underlying query (look at the Query property of the value prompt to find out).  If it does not have a query, add a query via the Query Explorer, add a Data Item to the query, and code it with the same expression you used in your calculated field.  If the query already exists, check what data item exists within it, and either add or amend it as above.

Finally, go back to the properties of your Value Prompt, add the query to the Query property, then set your data item as the use Value.

Regards,

MF.