Cognos :How to Create Small Sample Sizes


Overview


This document shows an example of data in small sample sizes in Cognos.

Steps to Take


  1. Use ‘SAH-Enrollment-View’ as the data source and include ‘Term Code’ and ‘Graduate Primary Major’ and ‘Student Count’ data fields in the Cognos list report

    Screenshot: Data fields in the Cognos list report


  2. Select Toolbox icon as highlighted in yellow and double click on Query Calculation as indicated in red arrow

    Screenshot: Toolbox icon


  3. You will see the following screen:

    Screenshot: Page titled Data Item expression - Data Item 1

  4. On this screen:
    1. Enter Name as ‘Calculated Student Count

      Screenshot: Example of entering the Name


    2. Enter ‘Case when’ inside the Expression Definition box and the syntax of case [expression] when ...end statement will show up within the information box.

      Screenshot: Example of setting Expression Definition as Case when


    3. Click on Data items then Double Click on Student Count 

      Screenshot: Arrow that points to the location of the Student Count component and data item icon on page


    4. [Student Count] will automatically be added inside the Expression Definition box

      Screenshot: Example of setting Expression Definition as Case when[Student Count]

    5. Put in the following syntax inside the Expression Definition:

      For [Student Count] as shown in Case when [expression]…End statement, you just need to double click on Student Count data field and it will be added to the Case when[expression]…End statement.

      Case when [Student Count]<10
      Then 'Count<10'
      Else
      Cast([Student Count], varchar(8))

      End

      Note: Use String data type after Then and Else statement. That is why we have to use Cast([Student Count], varchar(8)) function to convert Student Count data field from Numeric data type to String data type for Else statement use.

      Screenshot: Above code written in Expression Definition

  5. Click on Validate icon as indicated in red arrow and ‘No errors’ is shown inside the Information box. 
    Click OK.

    Screenshot: Validate icon


  6. Click on Run Options icon as indicated in red arrow and select Run HTML

    Screenshot: Run icon and Run HTML option

  7. The Report Output is shown as below

    Screenshot: Example Report Output

 

If you still have questions or need additional assistance, please submit a ticket or email busintel@ucsd.edu.