COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Dashboards => Topic started by: Cognos24id on 19 Jan 2024 06:57:19 AM

Title: SHOW TOP 10 and 20
Post by: Cognos24id on 19 Jan 2024 06:57:19 AM
Hi Folks,

I have a question regarding the case to show top 10 and 20. I tried several ways based on the information in this forum, still didnt works yet.

The goal is I wanna show top 10 and 20 products based on the YTD data and Profit center.

I used this function :

if (?p_prd? ='TOP 10') then (topCount([list of products],10,[YTD])) else if
(?p_prd? ='TOP 20') then (topCount([list of products], 20,[YTD])) else ([list of products)


it works tho, if I choose prompt TOP 10, Cognos only show 9 list of products and if I choose top 20 Cognos only show top 13 and the rest Cognos show random rows.

could you help how I can show the top 10 and 20 with topCount() function?
Fyi,  [list of Products] ---> calculated data item
       [YTD] ---> Calculated measure
       [Profit center] ----> calculated data item

Thanks in advance

I attached the illustration of my report.   

[/list][/list][/list][/list]