Solved Charts (1 Viewer)

althaherm

New member
Local time
Today, 17:29
Joined
Mar 31, 2021
Messages
22
Dear All,

Kindly, I have tables and each table contains a Yes/No field, I need to create a chart that shows how many Yes and how many No in each table.

something like the attached photo.

Thanks in advance for your help.
 

Attachments

  • Screenshot 2021-04-08 124309.png
    Screenshot 2021-04-08 124309.png
    5.6 KB · Views: 269

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:29
Joined
May 7, 2009
Messages
19,230
Code:
SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table1" AS Expr1
FROM table1
GROUP BY "Table1"
UNION
SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table2" AS Expr1
FROM table2
GROUP BY "Table2"
UNION
SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table3" AS Expr1
FROM table3
GROUP BY "Table3"
UNION
SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table4" AS Expr1
FROM table4
GROUP BY "Table4"
UNION SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table5" AS Expr1
FROM table5
GROUP BY "Table5";
 

harpygaggle

Registered User.
Local time
Today, 07:29
Joined
Nov 22, 2017
Messages
128
How many data do you have? You may also use pivot and from there create a table.
 

althaherm

New member
Local time
Today, 17:29
Joined
Mar 31, 2021
Messages
22
Code:
SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table1" AS Expr1
FROM table1
GROUP BY "Table1"
UNION
SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table2" AS Expr1
FROM table2
GROUP BY "Table2"
UNION
SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table3" AS Expr1
FROM table3
GROUP BY "Table3"
UNION
SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table4" AS Expr1
FROM table4
GROUP BY "Table4"
UNION SELECT Count(IIf([YesNoField],1,Null)) AS Yes, Count(IIf([YesNoField],Null,1)) AS [No], "Table5" AS Expr1
FROM table5
GROUP BY "Table5";
Dear arnelgp

Thank you, can you please guide me where and how to insert the code, is it going in the table or? sorry but I am just a beginner. thanks again
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:29
Joined
May 7, 2009
Messages
19,230
see this demo.
i have 5 tables.

query1 is first made
then make query2.

create a new form (formModernChart) and i inserted modern chart (column Clustered).
the rowsource of the chart is query2.

open the form.
 

Attachments

  • modernChart.accdb
    576 KB · Views: 321

althaherm

New member
Local time
Today, 17:29
Joined
Mar 31, 2021
Messages
22
see this demo.
i have 5 tables.

query1 is first made
then make query2.

create a new form (formModernChart) and i inserted modern chart (column Clustered).
the rowsource of the chart is query2.

open the form.
Thank you, I am attaching a sample of the tables. the field that I am trying to use it in the chart is (HSE approval). from all the tables.
 

Attachments

  • Database3.accdb
    464 KB · Views: 188

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:29
Joined
May 7, 2009
Messages
19,230
see form1
 

Attachments

  • Database3 (1).accdb
    484 KB · Views: 309

Users who are viewing this thread

Top Bottom