Prashant Mishra
Prashant Mishra

Reputation: 647

Cognos Report Rendering Issue: Gender Field Visibility Based on Customer ID Count

I have a Cognos report connected to an Oracle database, featuring 4 prompt pages : enter image description heredesigned using a table structure with two columns: one for description and the other for Cognos value prompts .

On the first prompt page, users input customer IDs, and on the second page, there are fields displaying Average Salary, Average Age, Average Height, etc., including a Gender Field. My objective is to show the Gender field only if just one customer ID is entered on the first prompt page.

To achieve this, I created a separate query to return the count of customer IDs selected on the first prompt page. I then used the output of this query to create an expression for a variable. Expression is as follows:

if ([Main_Case_List_Count].[CASE_COUNT] = 1) then (true) else (false)

The variable was successfully validated without errors. Subsequently, I implemented rendering using this variable, intending to display the Gender field conditionally.

However, when I run or validate the report, it throws an error : RSV-VAL-0034 Failed to validate the variable Boolean1. CRX-YXX-4010 A parsing error was found at or near the position 58 in the expression "if ([Main_Case_List_Count].[CASE_COUNT] = 1) then (true) else (false) "..

. I'm seeking guidance on how to troubleshoot and resolve this issue. Any insights into why the data item might not be recognized during runtime would be highly appreciated.

Upvotes: 0

Views: 60

Answers (1)

Daniel Wagemann
Daniel Wagemann

Reputation: 851

You shouldn't need another query to do this. Create a string variable with the following expression, where PL is your prompt name.

 if (ParamDisplayValue('PL') is missing)  then  ('NoDisplay') else
('Display')

The string variable will need the two values added, NoDisplay and Display.

Once that is in place you can try this to a render variable on the singleton or List column depending on what you are using.

Upvotes: 0

Related Questions