Cross-Tabulate Non-Numeric Data in Cognos BI

ⅰ亾dé卋堺 提交于 2019-12-13 05:47:46

问题


I have a set of data which right now I have in a List. It looks something like this (sample data obviously)

Event ID | Field Name | Value
-------------------------------------
EV123    | Name       | John
EV456    | Name       | Karen  
EV789    | Name       | Bob 
EV123    | City       | New York
EV456    | City       | Chicago
EV789    | City       | Los Angeles
EV123    | State      | NY
EV456    | State      | IL
EV789    | State      | CA    

The Event ID and Field name values are all unique - for each combination of Event and Field Name there is only 1 row. There are about 50 Field Names and they will change from time to time.

I'm trying to do a cross-tab or other similar layout to instead show the data laid out as such:

Event ID     | Name        | City         | State     
---------------------------------------------------
EV123        | John        | New York     | NY
EV456        | Karen       | Chicago      | IL
EV789        | Bob         | Los Angeles  | CA

I have tried doing a cross-tab in Cognos which properly shows the columns across the top row and the Event IDs along the first column, however even when I drag the "Value" column into the section where I expect to see data, nothing is showing. I think this is because it's trying to sum or aggregate the data which isn't numeric.

How can I achieve the layout I'm trying to go for here? Please keep in mind that I am a Cognos newbie and don't have a great knowledge of SQL, so the more guidance you can provide the better!

Thank you in advance.


回答1:


Here are the steps to add a non-numeric column to the measure area of a crosstab:

  1. Drag over a Crosstab Space object from the toolbox and drop it on the column header section just to the right of the last column
  2. Select the empty fact cells under the new crosstab space
  3. Set the ‘Define Contents’ property to ‘Yes’
  4. Unlock the report
  5. Drag over the non-numeric data item either from a model or an existing query and drop it in the empty fact cells
  6. Click on and highlight the right-most row header item
  7. Click on the ellipsis in the ‘Properties’ property to bring up the ‘Properties’ dialog box
  8. Check the data item corresponding to your newly-added non-measure column and click ‘OK’
  9. Configure a header label for the new column. This can be done by either dragging over a text item and manually entering the name or via the ‘Source Type and ‘Data Item Label’ properties.


来源:https://stackoverflow.com/questions/52101741/cross-tabulate-non-numeric-data-in-cognos-bi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!