cognoscognos-bicognos-11

How do i count only those records that are being shown based on a parameter in cognos and not the entire data based on a condition?


Okay so i have a data sheet which has Purchase Order data in it with dates included now i have created a new report with a date prompt page where the user chooses the start and end dates and based on that we will show the PO's which fall in between that date. Also i want to count PO's based on their individual statuses. However the count is showing the entire thing. Like suppose there are 10 approved PO's and based on the date selected by the user there is only 2 approved PO, so i need the count to show it as 2 and not 10 which is coming right now.

I am a cognos newbie


Solution

  • THE ANSWER WAS SIMPLE. THANKS TO THE CLUES PROVIDED IN SYNTAX BY DANIEL WAGERMANN, I SIMPLY DEFINED 2 PARAMETERS TO CAPTURE THE START AND END DATES

    COUNT ( IF([STATUS]='APPR' AND [DATE] BETWEEN ?STARTDATE? AND ?ENDDATE?) THEN (1) ELSE NULL FOR REPORT)

    I HAD ISSUES WITH BRACKETS HENCE WAS GETTING ERROR BUT NOW IT IS WORKING FINE.