How to add county to a Cognos report.

Creation date: 7/9/2025 9:45 AM    Updated: 7/9/2025 9:48 AM
  1. In the left sidebar, select the Queries icon, and then click the + icon to add a query.

  2. In this same view select the “Queries” folder so we’re in the Queries view on the right hand side.
  3. In the left sidebar, select the Toolbox (hammer).
  4. Click/hold the SQL icon, drag it on top of the query you just created, and then let go. You should now see an error showing that the query is being populated by SQL.
  5. With the SQL icon selected, click the properties icon in the upper navigation.
  6. Double click the “Data source” field, select “JX Enterprise” and click “OK”. This tells Cognos what database to connect to.
  7. Double click the SQL icon to pull up the SQL edit window.
  8. Enter the following code in the window and then click “Validate”
    select res_cty, id from profile_rec
  9. When the “Select a Connection” window pops up, select “huadmin-jxsemlive” and click “OK”.
  10. Click “OK” in the “Validation successful” window.
  11. Click “OK” in the SQL edit window.
  12. When you navigate back to the main query window and select the query you created, you’ll now see that it pulled in two data items (res_cty and id). "res_cty" is the county, and "id" is the constituent's Candidate ID.
  13. 13. Join this query to another by linking “id” to “Candidate ID” and you should now be able to display the constituent's county in your report.
Cognos