Hi Priyanka,
what Patrick described is to add a query calculation to your report.
From the Insertable Objects click on toolbox. Under TEXTUAL you'll find Query calculation. Drag it into your report.

An expression editor will open: Give a meaningful name and add the calculation in the expression definition box.
Then either type in the calculation or choose from a list of various functions.
Look for the corresponding icon below Available Components. count() is listed under Summaries.

This is in general described here https://www.ibm.com/docs/en/cognos-analytics/11.2.0?topic=calculations-insert-query-calculation
Best regards
------------------------------
Gertrud Lohwasser
------------------------------
Original Message:
Sent: Mon May 23, 2022 09:13 AM
From: Priyanka Joshi
Subject: please help with below report
How to find count I am still not getting.could you please guide
| Code | Count | Amount |
| 6 | | 10 |
| 6 | | 20 |
| 5 | | 30 |
| 5 | | 40 |
| 5 | | 50 |
here code should be counted and grouped
result should be like
| code | count | amount |
| 6 | 2 | 30 |
| 15 | 3 | 120 |
Original Message:
Sent: 5/19/2022 10:53:00 AM
From: Patrick Neveu
Subject: RE: please help with below report
Hi Priyanka,
You need to create a count query calculation that will use the following expression:
Count([Description] for [Code])
Best regards,
------------------------------
Patrick Neveu
Positive Thinking Company
------------------------------