Results 1 to 4 of 4
  1. #1
    CellOut is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2017
    Posts
    3

    How best to design a database to query time series data in different table with common field names

    I am trying to move a large Excel document into MS Access but I have not used Access for some time and would really appreciate some advice as I may be heading off in the wrong direction here or missing something obvious.....

    In Excel the data is organised in multiple sheets with each sheet have Time in the first column in 5 minute steps (so best to be a primary key field?) and the heading of the following columns (Fields?) all being a unique item name (in the example below 'ItB' 'ItC' etc). In each of the cells is a number value for each time/item. There are a number of these sheets.

    Table1
    Time ItB ItC ItD
    00:05 1 0 2
    00:10 1 1 2
    00:15 1 0 2

    Table2
    Time ItB ItC ItD
    00:05 2 1 2
    00:10 1 1 2
    00:15 1 0 2

    Query1 (Table1 x Table2)
    Time ItB ItC ItD
    00:05 2 0 4
    00:10 1 1 4
    00:15 1 0 4




    There are then separate sheets, with the same column headers (and with the same time stamp) which have a value in each cell based on a calculation from the relevant time/item in two or more sheets (sometimes simple addition or multiplication, sometimes with IF etc). I have put an example 'Query1' showing the relevant values in 'Table1' and 'Table2' multiplied. In reality the number of time slots might run to >100,000 and the number of Items could run into 1,000's (not that it does in Excel currently).

    I would assume I create a relationship on 'Time' but can I also somehow link the Field Names so that it is Table1_ItB x Table2_ITB or do I need a table with a unique ID, Time, Item, and Value instead (which then would need two relationship links against Time and Item? and be a lot harder to for me to upload data from my existing sources)

    I need to be able to upload data from Excel periodically to add more data to some of the tables (adding extra time slots to the end of the data) which would then create new data on the queries. It is easiest to upload a few single sheets (one for each table). Also, if there is not another way, I would need to make an individual Field in each Query for each item (ItBxItB, ItCxItC.....), I am hoping there is something much easier than this......

    Can anyone help point me to an example that would get me started in the right direction?

    Many Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    In access you'd append all sheets of all excel files into a single table, tData.
    youd also have tables for the IDs: itB, itC, itD.

    then you can join the tData to the tID tables.

  3. #3
    CellOut is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2017
    Posts
    3
    I think it is coming back to me now, I can just build queries in SQL instead.....

  4. #4
    CellOut is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2017
    Posts
    3
    Thanks ranman256, I appreciate the speedy reply

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

Similar Threads

  1. Time-series database for monthly loan balances
    By rlmax in forum Database Design
    Replies: 6
    Last Post: 03-08-2017, 09:15 AM
  2. Replies: 11
    Last Post: 03-02-2016, 11:01 AM
  3. Replies: 25
    Last Post: 09-01-2015, 07:15 PM
  4. Make time series data
    By klh_2012 in forum Access
    Replies: 1
    Last Post: 03-13-2012, 02:19 AM
  5. Replies: 1
    Last Post: 05-17-2010, 12:21 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