Results 1 to 5 of 5
  1. #1
    EdaxFlamma is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jun 2013
    Posts
    34

    Report chart code: ISNULL or ISImpossible?

    Hey all,

    I have several charts on a report that are populated using code similar to that which is found below.

    Code:
    SELECT (Format([ShipDate],"WW" )),Sum([AmtUnits]) AS [SumOfAmtUnits] FROM [q_MonthlyShip]   
    GROUP BY (Year([ShipDate])*CLng(54) + DatePart("ww",[ShipDate],0)-1),(Format([ShipDate],"WW" ));
    When I have sales data for each week, all the charts populate normally. If I fail to have sales data for that week, the entire week is omitted from my graph. See attached picture below (pardon the scale issue):
    Click image for larger version. 

Name:	DatabaseTesting8.jpg 
Views:	12 
Size:	46.3 KB 
ID:	13083



    My goal is to have the Product2 x-axis mirror the Product 1 graph despite the fact that there are no sales for that product for weeks 21,22,25,26,28,29.

    My first thought was to try and shove an ISNULL [AmtUnits],0 in there to set the number of units sold per week to 0 but I can't seem to get it to work. After thinking about it however, is what I am trying to do even possible given that Access doesn't "know" that those weeks exist without [ShipDate]s to go off of?

    If I can provide more information please let me know.

    Thanks a bunch!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,598
    Maybe. What chart type are you using? A Scatter type might get you what you want. All of my graphs are Scatter. This allows me to set scale of x and y axes. The data has to be numeric. The Format function results in a string, even if it contains only digits, might still be treated as a string by the graph engine. DatePart() results in a number value. Or use Val() on the Format() result.

    I analyse graph issues best with data. If you want to provide, 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.

  3. #3
    EdaxFlamma is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jun 2013
    Posts
    34
    Sorry it took so long for me to get back to you. Had to cull a lot of data...

    Be forewarned that this is only a partial database and that it does contain many examples of bad practice. I'm trying to focus on salvaging what I can from this database and build a new one in my "spare time".

    If I can be of any more assistance or clarify anything please let me know.



    NoSalesCharts.zip

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,598
    I opened the report and Product1, Product2, Product3 graphs show X-axis with no gaps - Product4, Product5, Product6 do show gaps.

    The report opened without error to ReportView but when sometimes when I switch to DesignView and always direct PrintPreview, get:
    The record souce "SELECT (Format([ShipDate],"WW")),..." specified on this form or report does not exist.
    Followed by:
    An error occrred while sending data to the OLE server (the application used to create the object).
    Then Product2 graph won't display in PrintPreview.
    AhHah - Product2 is misspelled as Prodcut2 in the RowSource SQL.

    I am afraid the only way to get what you want is to make sure there is at least one record for each week. Scatter chart will show a scale without gaps but it will start at 0 unless you manually change it or use VBA to automate. Also, it won't show a continuous line because the data still has gaps.
    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. #5
    EdaxFlamma is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jun 2013
    Posts
    34
    I wondered about that (isimpossible). I'll check out the scatter plot and see if that works better for us. Many thanks and my apologies for the typo... Dyslexics of the world untie!

    I think we are solved but I'll let you close us out if you have anything else to add. Much appreciated again!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Chart is not showing up on the report.
    By Guntar in forum Programming
    Replies: 1
    Last Post: 12-19-2012, 03:11 PM
  2. Adding a chart to a report
    By Bigmix in forum Reports
    Replies: 7
    Last Post: 02-14-2012, 08:47 AM
  3. Line chart in access report
    By drp in forum Reports
    Replies: 2
    Last Post: 11-29-2011, 09:37 AM
  4. generate a chart report
    By smahdih in forum Reports
    Replies: 4
    Last Post: 11-28-2011, 02:39 PM
  5. Pie Chart Design for Report
    By maggioant in forum Reports
    Replies: 0
    Last Post: 10-13-2009, 03:06 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