Results 1 to 7 of 7

Thread: data relationship

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    data relationship

    at intervals i am sent a .xls spreadsheet, with updated pricing
    the data also includes cross references to equivalent products in columns F to howevermany, see sample
    this workbook contains 37k lines, may vary in different versions, as shown not all lines have cross references
    Name:  clipic.jpg
Views: 169
Size:  34.5 KB

    in many cases the a lot cross references have been dropped from later versions of the data, so i want to record all cross references from the different versions, before the information is lost

    i need to either bring the xrefs from each version into the latest workbook or else possibly set up an access database, with a simple vb6 front end, and import any additional xrefs from new versions when they arrive

    any suggestions for setting up database tables to link all equivalent items
    or
    copy all the cross reference into the current workbook, so that all the xrefs are applied to each other, when looked up from the UI sheet
    note in rows 2 and 3 several of the xrefs are the same, so effectively item 2 and 3 should xref
    all items in the xref columns should also be in the item column, with xrefs to the same items

    i can use ADO to select all items on sheet with xrefs, but need some ideas to process the data and store
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: data relationship

    Is there ever more than one cross reference for an item, or is it a case of "if the new record doesn't have a cross reference, use the previous cross reference?"

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: data relationship

    Is there ever more than one cross reference for an item
    as seen on the image above, any number (up to 5 on the image) of xrefs per item
    records on more recent sheet may have different, same, more or less xrefs (mostly less or none)

    damned if i know why they drop the xrefs,
    currently i have to keep opening old price lists to find xrefs then look up in the current price list
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: data relationship

    Okay. I missed the "F to howevermany" part. So in the case of row 2 in your image, what happens if the next file comes to you with 5 xrefs also, but they're not the same 5. Is that a possibility, or no?

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: data relationship

    Is that a possibility, or no?
    yes, but i would assume unlikely
    different xrefs should be added and each xref should also be added to all items for reverse xref,
    so all xref items in row 2 should also be on the row for each of those items, plus the item from row 2 (col B)

    while later files come with some xrefs, seems to be a lot less
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: data relationship

    I would lean toward creating a vertical list in Excel, with a 1 to 1 relationship between "item" and "xref," then importing that into Access each time you get a new file, then comparing with both a left and a right join to see if you ever get any new xrefs. Add the new to your Access table "master" and use it to guarantee price list accuracy, if that makes sense?
    Attached Images Attached Images  

  7. #7
    Registered User
    Join Date
    Jul 2015
    Posts
    1

    Re: data relationship

    This is very nice and really appreciating.
    Everyone one should visit this thread once.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width