Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    carojasa is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    18

    How to normalize monthly data in an ordered numerical sequence???

    I am desperate!!!


    I need an expert to help me solve my problem. I am a geologist using an access database with very little programming knowledge. I will be extremely grateful if you can help me through this obstacle.

    1. The setup of my table is shown in the picture Click image for larger version. 

Name:	Table setup.JPG 
Views:	19 
Size:	36.6 KB 
ID:	19576

    I have a number of well locations listed as "CAP Pretty Well ID's". These IDS occur many times in this particular table because they contain data recorded in a historical month -to-month basis in which the total number of hours of operation per month were logged. (I am basically explaning the content of my table from left to right so you can understand)

    The field containing the dates, listed in yyyy-mm is of no use to me. Example: For ID 1171 i have dates from 2014-06, 2014-07......., 2014-09

    I would like to have a column populated with numbers from 1 to n.... indicating to me that 2014-06 is month 1, 2014-07 is month 2 etc etc etc....
    I have spend two days trying to do this myself and I am frustrated.

    Can you help me please? Step by step instructions would be appreciated.

  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,626
    This is ranking records. For some techniques, review http://allenbrowne.com/ranking.html

    Should the records be sorted by yyyy-mm for the numbering? Should the numbering be within each ID group?
    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
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Well, let's start by having you define/describe the problem in plain English. Changing that column to 1...n is not the issue. We want to know WHAT you are trying to accomplish in business terms, plain English, no jargon. You have told us HOW you think you will solve something. It's the something we're trying to understand. What does the table represent?

  4. #4
    carojasa is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    18
    The way i got the data was in YYYY-MM . Basically, I have wells from the 1960's which have operated for decades! As shown in the example, Monthly HRS of operation is one of the many parameters recorded.
    The numbering should be within each ID group. For example, ID 1171 should have 5 records numbered 1,2......,5 and ID 3045 should have 6 records numbered 1,2.....,6.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    What if you had 2 tables. Normalized

    Wells and WellsProduction. And then joined the tables on WellId and ordered the data by Date ascending.

    where Wells

    WellID
    WellName

    And WellsProduction
    WellID
    Date (reserved word)
    PRDMonthlyHours_hrs

  6. #6
    carojasa is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    18
    Dear Orange. I apologize.
    The table represents monthly hours of operation per well ID arranged from Oldest to Newest.
    I need to rank my data from oldest to newest within each ID. Thank you for your help.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Did you review the link in post 2?
    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.

  8. #8
    carojasa is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    18
    Dear all.
    I will attempt to clarify my problem and clear up any confusion.

    My ID's contain data arranged by date. The dates are ordered from oldest to newest. I have 1000's of IDs
    The records contained in the Date Field are in the format YYYY-MM
    I need to keep the order in which the data is stored BUT I need to create a new column that can rank the records within each ID from oldest to newest starting with number 1 to number XXX.

    I hope this is better explained.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Can you post some of your sample data in csv format. (or txt)?
    I'd still like to know WHAT your objective is.

  10. #10
    carojasa is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    18
    Reading through the link. I don't really understand it much

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Keep in mind that tables don't really have a 'stored order'. Order is defined by sort criteria.
    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.

  12. #12
    carojasa is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    18

    sample file

    Sample.txt


    took me awhile to upload the sample file. sorry

  13. #13
    carojasa is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    18
    I hope the file clears up the confusion.
    Basically.
    Thousands of ID's with monthly data.
    I want to set the sort criteria from Oldest to Newest and then get access to provide me with a column in which the records are ranked from 1 to XX within each ID number

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Don't think we are confused. The referenced link provides techniques for dynamic sequential numbering of records within groups. However, if you want to commit that number to table, will probably require VBA code.
    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.

  15. #15
    carojasa is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    18
    I dont think you are confused June

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

Similar Threads

  1. Replies: 6
    Last Post: 10-20-2014, 05:43 PM
  2. Replies: 6
    Last Post: 11-10-2012, 09:49 PM
  3. I am so confused on how to normalize the data? please help???
    By coffayndtea in forum Database Design
    Replies: 2
    Last Post: 03-28-2012, 07:52 PM
  4. Using Query to De-normalize Data!
    By DNRTech in forum Queries
    Replies: 8
    Last Post: 03-13-2012, 01:53 PM
  5. Replies: 1
    Last Post: 05-23-2011, 02:15 AM

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