Results 1 to 14 of 14
  1. #1
    Skizzly is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    8

    Question Show differences on chart


    Hello experts,

    I have a two tables. The table1e shows the a count of staff on shift every day.

    The table2 shows when a person in the first table changes their working pattern.

    What i need is some guidance on how to represent the change in working pattern compared to the table1's values... and represent this on a line graph...

    i want to show table1's line and see what the impact of table2 changes will have on the numbers in table1...

    I have attached sample table with dummy data
    Attached Files Attached Files

  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,770
    You need to show 'dummy' chart.

    What do the 1's in table2 represent - 1 person changed work pattern? Changed how - added or removed?

    These tables are not normalized and I suspect what you want will not be simple because of that.
    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
    Skizzly is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    8
    Hi June,

    Thanks for the reply.

    I was of the thought to use a line graph of the values in table1 and then somehow show the plus or minus change for a worker against the total values in table1... that's the issue i need your expert ideas on....

    The ones in the table2 represent a change of a work pattern, the values here i wanted to be added or removed from the over all counts in table1.

    Normalized? I am not sure how the table could be normalized... each column in table1 describes a 15 minute period of the day and the number of staff needed to cover that period... how would you suggest it be normalized to be more efficient to achieve my aim?

    I have attached a new zip with form in with chart

    thanks in advance for any suggestions
    Attached Files Attached Files

  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,770
    Normalized table structure:
    PatternStart Period Quantity
    5/1/2015 06:30 25
    5/1/2015 06:45 25
    5/1/2015 07:00 25
    5/1/2016 07:15 25

    If both tables have this structure, they can be joined on the two common identifying fields (PatternStart, Period). The 2 Quantity fields can be used in expression to calculate difference.

    With current structure, could join tables on the PatternStart fields then would need 98? calculated fields in query if you want to calculate change for each period.
    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
    Skizzly is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    8
    Hi june, please see the new zip...

    i was wanting to present the data in table1 in the chart and then when a change occurs then the change is represented on the chart from table2

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Okay, try a UNION query.

    Build and save UNION query object. There is no wizard or builder, must type into SQL View of query designer.

    SELECT *, "T1" AS Source FROM table1
    UNI ON SELECT *, "T2" FROM table2;

    Then the graph RowSource would reference the UNION query instead of tables.

    If you started with a normalized structure, a CROSSTAB query would be the graph RowSource to get the output you want.
    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. #7
    Skizzly is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    8
    Thanks June,

    Should i redo the table structure to your suggestion? is it the best way to house this data? The intention is to have several years worth of data stored and repeating the period in the way you suggest, is it better than how i have the table designed?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Normalized is usually best but non-normalized can be dealt with, as I have demonstrated.

    As I said, with normalized structure, a CROSSTAB would be used but CROSSTABs have their own issues. I've never needed them. http://allenbrowne.com/ser-67.html

    IMO, it is a balancing act between normalization and ease of data entry/output.

    Understand the alternatives and do what works best for you.
    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. #9
    Skizzly is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    8
    Appreciate the time you have taken to assist... see attached...

    I have not normalised to your structure but have done the union query... the help i need was to show what the impact of table1 would be on table2 add or subtract and represent it on a line graph... is this possible?
    Attached Files Attached Files

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    As I said, build query that joins your tables and calculate 98? fields in query to show how the value would change. This query can be source for another SELECT line in the UNION. Here you are facing one of the main perils of non-normalized data - difficult calcs.

    So far we have 3 queries to get the output you want. Tables and queries have a limit of 255 fields.

    Query 1 joins the tables and does calcs
    SELECT table1.PatternStartDate, {98 calculated fields}, table1.LAG FROM table2 INNER JOIN table1 ON table2.PatternStartDate = table1.PatternStartDate;

    Query 2 is the UNION
    SELECT *, "T1" AS Source FROM table1
    UNI ON SELECT *, "T2" FROM table2
    UNI ON SELECT *, "Q1" FROM query1;

    Query 3 is the graph RowSource
    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. #11
    Skizzly is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    8
    Thanks June

    Will follow your advice and see if i can achieve the output needed.

  12. #12
    Skizzly is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    8
    Hi June,

    Would the calculated field would be table1.field(00:00) +/- table2.field(00:00)?

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    But you have to pick one operator sign. Do you want to add or subtract? Enter data as a positive or negative and then just use + operator.

    table1.[00:00] + table2.[00:00]
    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.

  14. #14
    Skizzly is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    8
    thanks again for help

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

Similar Threads

  1. Replies: 6
    Last Post: 08-27-2015, 11:35 PM
  2. Replies: 1
    Last Post: 08-07-2015, 08:24 AM
  3. Show all category in a chart
    By Ray67 in forum Reports
    Replies: 22
    Last Post: 01-20-2013, 09:15 PM
  4. Compare and show differences ...
    By raghuprabhu in forum Queries
    Replies: 5
    Last Post: 05-18-2012, 06:05 PM
  5. Chart doesn't show data
    By pbaxter in forum Forms
    Replies: 5
    Last Post: 01-20-2010, 11:09 AM

Tags for this Thread

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