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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pie charts for multi-response fields?

Status
Not open for further replies.

waldopepper

Programmer
Nov 21, 2003
124
0
0
GB
Hi - I have a multi-response field in my database that I've split out into individual answers:

e.g.

How did you become aware of this product?
Field1: 'Y' = Newspaper
Field2: 'Y' = Online
Field3: 'Y' = TV

etc
where one record could have ticked Y to all three of these.

The rest of the single-answer fields in my report are being shown as pie charts so I would like to follow this format for this question. Can Crystal Reports plot multiple variables like this and force them to add up to 100% (total answering any value) for a pie-chart presentation?


thanks
W

SQL 2000
Crystal Reports v10
 
If people could respond to all three, then what would the pie chart be based on, since it couldn't be based on a distinctcount of person. If you base it on all responses, then one person may have more impact on the results than others.

-LB
 
That's what I was kinda getting at - can you somehow base the figures off Total answering (total tickes) rather than total records? Really this makes it a different level to the other charts that are all based off total records so it might not be possible.

It's OK to have one person impact the answers because if one person saw an advert in a newspaper and on TV then we want to count both 'ticks'.

Pie charts aside though, if I can show these values in any sort of chart then it would be useful - but I can't seem to get anything like this working in bar charts etc as well.

ta
 
You might want to do this in a subreport, where you use a command as your datasource, so that you can merge the results all in one field like this:

select 'Newspaper' as type, table.`field1`
from table
union all
select 'Online' as type, table.`field2`
from table
union all
select 'TV' as type, table.`field3`
from table

Adjust the punctuation and syntax per your database.
Then you should be able to insert a pie chart that uses {command.type} as the "on change of" field and count of {command.field1} as the summary field.

-LB
 
mmm thanks - can you generally use a command as a datasource (in a main report)? I can't seem to find this option - is it definitely in v10?

thanks
 
I meant for you to do this in a subreport where you could just work with those three fields. You could create a command within a report by going to database->database expert->your datasource->add command, but I meant for you to insert a subreport->datasource->add command and enter the query there and then create the chart within the subreport.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top