Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pivot or crosstab data in crystal 9 or 2008 1

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
US
I have a data table I bring into crystal as such
key(number) id(varchar) comment(text)
1235 122 Midwest
1236 122 South

I want to use sharedvar to show the data horizontally and do a reset to show the next instance of the comment
for example ID 122 has two comments. The key forces the number of comments, so I need to show like this
ID comment1 comment2
122 Midwest south

I cannot hardcode the comment because there are 300. I dont think I can do this in a basic crosstab. By the way this needs to be in a spreadsheet format
 
Have you tried inserting a crosstab that uses ID as the row, key as the column and maximum of comment as the column field?

-LB
 
Wow you are a genius. One more question though. It formats as a true crosstab. I need this to fit with about five other fields in a spreadsheet type format. I need to get rid of the totals and just show
the comment only. I need a header at the top or report header and show the comments in the group, along with the other data. But thanks again because this has been a real struggle
 
Can you show a sample of how the report should look and label the additional fields that need to appear?

-LB
 
How it looks now(represents the sql field name)
ID(id) NAME(name) COMMENT(attrcomm) attrky(notvisible)
1233 James Smith fishing 1255
1233 James Smith boxing 1256
1234 Sam Smith biking 1258

I want it to look like this. Note the output will go on an excel spreadsheet. Note the attrkey forces a new detail line

ID NAME COMMENT1 COMMENT2 COMMENT3 COMMENT4
1233 James Smith fishing boxing
1234 Sam Smith biking

A maximum of 4 comments are to show up. The crosstab you showed me fullfills the horizontal display of the comments. Its just that I need it fit on a spreadsheet. So I am trying to just show the instances of the comments in a column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top