IBM Support

Filter on rank data item does not bring the expected result

Troubleshooting


Problem

When filter on the result of a rank expression the result is not correct.

Symptom

Wrong result set with filter applied on rank.

Cause

The order in which the result of the rank is created and the application of the filter is somehow not correct.

Diagnosing The Problem

When you filter to show the result for "rank < 21" you will not get the first 20 of the result. (1,2,3,4,...20) Instead random rank values will be displayed. (2,6,8,16,19,...)

Resolving The Problem

You need to verify that the rank is created first and the filter is applied afterwards. In simple reports this seems to work without any workaround but for more complex reports it might be required to adjust the the order.

Usually you would have a query containing the rank function and the filter applied on rank result.

Steps:

  • remove the filter from the query containing the rank
  • create a new query and point the "Rank Query" to the new "Filter Query"
  • copy the data items from the "Rank Query" to the "Filter Query"
  • add the filter on rank to the "Filter Query"

You have to open the query explorer to edit the new query!

[{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Report Studio","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.4.1","Edition":"All Editions","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Report Studio","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.4.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
28 November 2022

UID

swg21454202