Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28
  1. #16
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772

    UNION does not allow duplicate records, UNION ALL will. The 'D' and 'X' calculate a value that identifies source of the record, hence the field name Source. This assures the 3 'dummy' records are not duplicates of any real records.

    Did you mean to say 'it isn't setting "low" to 1' - your narrative said 0.

    No idea why the other charts don't work.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Yes, I meant 1, not 0, sorry.

    And okay, I'll keep messing with it. Hopefully I manage to get them working.

    Thanks for all your help

  3. #18
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Okay, so this is really odd. I haven't changed anything, but when I opened up the report this morning, the Pie Chart is displaying incorrect percentages again (same as before, 33% for "High", "Medium", and "Low").

    Access Charts are going to be the death of me.

  4. #19
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Provide db for analysis. Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Cyber Risk Database - Working - Chart Troubleshooting.zip

    The report is called "rPieChartTest"

    The chart titled "Overall Risk" is tied to "qOverallRisk" -- This pulls from the field "riskRating" in the table "tScenarios"
    The chart titled "Overall Residual Risk" is tied to "qOverallResidual" -- This pulls from the field "residualRisk" in the table "tScenarios"
    and the chart titled "Risk Without Key Security Measures" is tied to "qNcmRisk" -- This pulls from the field "ncmRisk" in the table "tScenarios"


    Thanks again for the help

  6. #21
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Since you are charting a count and the count is 1 for each category, the percentages are correct.

    Since UNION query does not allow duplicates, will need to include scenarioID field. I should have noticed that before, sorry.

    SELECT scenarioID, tScenarios.riskRating, IIf([riskRating]="Low",1,IIf([riskRating]="Medium",2,IIf([riskRating]="High",3))) AS Expr1, IIf([Expr1]=1,"Low",IIf([Expr1]=2,"Medium",IIf([Expr1]=3,"High"))) AS Expr2
    FROM tScenarios
    UNION SELECT 0, "Low", 1, "Low" FROM tScenarios
    UNION SELECT 0, "Medium", 2, "Medium" FROM tScenarios
    UNION SELECT 0, "High", 3, "High" FROM tScenarios;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #22
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    I applied the changes to "qOverallRisk", but nothing changed on the chart. Am I missing something?

    Is there a more efficient way of displaying the number of "High", "Medium", and "Low" values in a column as a percentage?

  8. #23
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I did the suggested edits and definitely changed chart output. I also modified data so a category did not have any Low values. All works perfectly.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #24
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    I'm not sure how you got anything to change on the chart. Did you change anything in the RowSource property?

    I copy/pasted the code you posted into "qOverallRisk" and am not seeing any changes on the chart. I even removed all "Low" values in "tScenarios" and the chart is still displaying "Low" as 30%. The datasheet view of the query is also showing scenarioID = 0 72 times with High, Medium, and Low 24 times each, which I imagine is what's causing my issue.

  10. #25
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Only design changes were to the UNION queries. Turns out the calculated Source field is not needed but doesn't hurt to have.

    Oops, I copy/pasted the wrong SQL from earlier post. Remove ALL from the query. Review edited earlier post again. At least you now see what using ALL does.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #26
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Both Print and Report view are still not showing correct data. There is not a single instance of "Low" anywhere, yet "Low" is still listed at 30%.

    Like I said, I think the issue is coming from the 72 records appearing on the query that shouldn't be there. 24 are "Low", 24 are "Medium", and 24 are "High", all of which have scenarioID = 0. Is this not occurring on your end?

  12. #27
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I must have edited post after you read it. Review again.

    I am doing these posts via phone not computer (internet connection issues) which is why I did not copy/paste sql from db. Sorry for confusion.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #28
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Awesome, everything appears to be working now, thank you! Hopefully I don't come in tomorrow and everything is suddenly broken again.

    I really appreciate your help, I doubt I would have gotten these charts to work on my own.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-12-2015, 10:46 AM
  2. Chart formatting
    By jherzog in forum Reports
    Replies: 3
    Last Post: 12-30-2013, 05:02 PM
  3. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  4. Need help formatting chart
    By NISMOJim in forum Reports
    Replies: 1
    Last Post: 08-22-2010, 10:02 AM
  5. Chart formatting
    By NISMOJim in forum Access
    Replies: 0
    Last Post: 07-31-2010, 08:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums