An error occurs when there is a conditional variable based on a query item that is not displayed within the current container on the report layout. This is due to new functionality in IBM Cognos that optimises the query to eliminate unused data items from the resulting query SQL or MDX. To include a query item on the layout without displaying the object requires that the query item be added to the properties of the container in the layout.
CRX-API-0005 An error on or around the position '0'. The variable named '[QueryX].[XXXX]' is invalid.
Resolving The Problem
Select the query item being used for the evaluation of the conditional variable in the report, under properties of the report object. For example, for a list object, click the ellipses next to "Properties" in the Data section of the List object properties.
Note: For other report types such as chart and crosstab, the data item must appear in the layout.
- Select the report object that has the conditional variable being used for formatting or anything other object that report user may be using with the conditional variable.
- Use the control above the properties pane to navigate the ancestor objects from the layout. For a list report, select the List object. For a crosstab report, select the Crosstab Node Member.
- Locate the Data section in the Properties pane for the List or Crosstab Node Member object.
- Within the Data section, click on the elipses "..." next to the Properties entry.
- Select the query item that is being used in the conditional variable expression.
- Click OK to return to your report layout. The data item should now be available within the scope of your List or Crosstab Node when the report is executed.
If the error still appears when a data item is being used directly on the page without a query container such as a list or crosstab then similar steps can be taken to set the available query items at the Page level...
- Select the Page object from the ancestor control after selecting any object in the page layout.
- Set the Query property of the Page object to reference the query containing the required data item.
- The list of available query items can now be set for the Page using the Properties entry in the Data section of the Page object properties.
15 June 2018