0
votes

I have created a query which returns the percentage of customers in my table that are male v female.

The results when I run this query look like so:

enter image description here

When I turn this query into a report (in tabular form) i have these two values nicely laid out. However, I also wish to have a pie chart in the report.

I have run the chart wizard and gone through it numerous times attempting to get a result, but each time i simply end up with either a completely blank pie chart, or a completely full pie chart.

I have also created a query which gives me the results in the form of integers (male customers = 13, female customers = 7) and tried the wizard using those values to only achieve the same result.

I also tried creating a query with a total count and tried to make a pie chart with that value and the 'male customers' value but again to no avail.

Does anyone know how to create a working pie chart?

Thanks

Edit: I should mention that I have already tried to find a solution to this on the internet but haven't found anything that works.

Edit2: I'm not sure if this helps but as I said above, i am also able to create a query which yields these results:

enter image description here

Edit3: Redid the queries as serperate

'Customer Gender Qry FEMALE':

SELECT Sum(IIf(cust_title In ("Ms","Miss","Mrs"),1,0))/Count(cust_title) AS Percentage
FROM [Customer Table];

enter image description here

'Customer Gender Qry MALE':

SELECT Sum(IIf(cust_title="mr",1,0))/Count(cust_title) AS Percentage
FROM [customer table];

enter image description here

1
Have you read this Post stackoverflow.com/questions/19312970/… ?asdev
Yes, I went over that and could not understand the 'Area' part.BlueRhapsody

1 Answers

1
votes

You need two rows for your chart. So build two querys, one for male and one for female customers. Combine them with a UNION Query and be careful, that the percentage-column is named equally in both sub querys. That is your source for the chart.

See also How to add a pie chart to my Access report