Alpha DevCon 2018
Results 1 to 9 of 9

Thread: Need Help with History Tables

  1. #1
    Member
    Real Name
    C. Michael Roberson
    Join Date
    Aug 2009
    Posts
    56

    Default Need Help with History Tables

    I am using A5 V10.5. I have buitl a couple of A5 databases, one desktop (DBF) and one web based (using SQL tables). I developed a database in Alpha Four that has been running for over 20 years. My projects are few and far between, so when I need to develop a new database, it is like starting the learning curve from scratch. I recently took some advice from Tom Giles (thank you Tom) who gently persuaded me to attempt this project using A5 DBF as opposed to SQL (back-end tables). I have done little coding with Xbasic, but have a halfway decent understanding of coding and have used Action Scripting.
    That is a bit of my background, showing I am a relative newbie and often need expert advice. Now to my project.
    I am developing a database using A5.DBF. This DB tracks service calls on devices, parts used in repair of those devices, movement of those devices between different sites, and both cost of parts and shipping costs.
    Scenario: A device fails onsite and requires service. The options are, a part is shipped to site for onsite repair by a tech, or the device is shipped back to the repair depot. In most cases, when a device is shipped back for depot repair, a replacement device must be sent to the site (minimizing downtime). Once the failed device sent to depot is repaired, it becomes a spare unit available for shipping to another site as a replacement. There are around 15 remote sites, so it is easy to see how a single device (tracked by serial number) can move around to different sites over a period of time.
    What I need to do for a failed device:
    - Create a work order ticket (WOT) with associated multiple service activities
    - The use of multiple parts for repair must be attached to the associated service activity, or activities
    - Track the movement of, and current location of each device(about 150 devices right now, but will grow to around 500 in a couple of years)
    - Track cost of all repair parts used as well as shipping costs
    I have tables and relationships set up for the handling of the work order ticket and associated service activities. I am pretty sure I have tables created for all of the data I will need.
    My big issue is creating history tables to track locations, movements, part usage and costs. Building these table relationships are more of a challenge than I have previously encountered. I am not looking for a total solution, but perhaps, some expert experience and knowledge to fire a spark of creativity in me that is lacking due to inexperience. Any help would be appreciated. I hope I have not been too vague.
    Thanks,
    Mike

  2. #2
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,911

    Default Re: Need Help with History Tables

    Happy to help Mike, and it's Ted, not Tom, but I answer to anything except " Hey! You!"
    In simple terms, suggest you create a Set with the various tables connected so you can add data at various levels.
    I am supporting an Alpha project at the moment, but will create an example later today for exploration.
    Here you go as one example; I haven't added a date or anything else, just some logic in a set. HIH.
    Attached Files Attached Files
    Last edited by Ted Giles; 10-11-2017 at 08:05 AM.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  3. #3
    Member
    Real Name
    C. Michael Roberson
    Join Date
    Aug 2009
    Posts
    56

    Default Re: Need Help with History Tables

    Ted,
    Thank you very much, once again. I am so sorry I got your name wrong. Had a senior moment there. I have been really busy today and have no had time to look in depth at what you sent, but I sure appreciate the help. I know you are busy with you business, so please don't spend too much time on this. Usually I just need some expert input to steer me in the right direction.

  4. #4
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,911

    Default Re: Need Help with History Tables

    I can always find 10 mins to help out.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  5. #5
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,119

    Default Re: Need Help with History Tables

    Hello Michael,
    From what I can garner from your description, this database seems to have four centers. Center #1 has to do with working device tracking. Center#2 has to do with non-working device repair. Center #3 is parts and services for repair. Center#4 is shipping.

    Center #1 is pretty straight forward, like a library system, who (locations) has what (devices).
    Center #2 I would treat like a Project. The Project is device services and repair.
    The use of multiple parts for repair must be attached to the associated service activity, or activities
    Track cost of all repair parts used as well as shipping costs
    The repair work would be Project-centered (device-centered) and that could have a single reference number (Work Order). Then I would have a Service set. The parent of the set would be a header table (Service) that has a field for it's own unique service ID, a field for the Project ID, a field for the device Serial#, and maybe a field for service type. The child table in the set would hold the specific parts and services for each service event. These service parts and services would be drawn from support table(s) in Center#3.

    I do a great deal of shipping in my work. I have found that shipping requires it's own center. My shipping center is composed of three tables - Header, Shipping Events, Shipping Costs. The header holds the Project. Projects have multiple shipping events. Shipping events have multiple charges. We use USPS, UPS, FedEX, and others. I have the shipping data in our database (URSA) uploaded to the shipper's desktop software or web sites for batch shipping, and downloads from their desktop software or web sites for importing the shipping charges and tracking numbers back into URSA. From this center the shipping costs are collected. When the Project is complete and all the shipping charges are in, for us, the Project is invoiced, collecting all the costs for parts and services and the shipping.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  6. #6
    Member
    Real Name
    C. Michael Roberson
    Join Date
    Aug 2009
    Posts
    56

    Default Re: Need Help with History Tables

    Mike,
    Thank you so much! You have drawn an interesting model assessment from the description I gave of what I am trying to do, that is, modularizing into "centers." My current model is pretty much like you described in the 3rd paragraph. I sent that set structure in a zip file. The Service_Activity table is a one to many child table of the Work_Order_Ticket table. The Part_Used Table is a one to many child table of the Service_Activity table. The Kiosk_Used and Kiosk_Rcvd tables are each one to one child tables of the Service_Activity table since only a single kiosk(device) is associated, for each of those two tables, with a particular Work Order Ticket.
    I have created history tables for tracking devices repaired, device movements, and parts usage, as well as shipping costs. I am in new territory with these history tables and am not sure how they should relate to the main tables/sets. Should I simply post data to these tables, or place them in a set? Although I am not using SQL tables, I know that a SQL developer would use triggers to post data from main tables to history tables. I think using A5 sets, field rules, XBasic (if I need to do some coding) should actually be more simple. I am having trouble visualizing how this table/set structure will look. Bottom line is, I want to create a simple report that shows device movement, eg., Device1 at Site1, moved to Site3 on DateX, then came to Repair Depot on DateX, then sent to Site5 on DateX, etc. Also reports on part usage, cost and shipping costs on repairs of devices. I hope that makes sense.
    Mike
    Attached Files Attached Files

  7. #7
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,310

    Default Re: Need Help with History Tables

    Something went wrong with your zip - I unzipped lots of sub folders but no AA files were found in any of them.

    Ok, found a set - but where are the tables that comprise the set?
    Last edited by MoGrace; 10-17-2017 at 10:27 PM.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  8. #8
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,119

    Default Re: Need Help with History Tables

    you haven't sent your database in a way that we can see it. Try again
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  9. #9
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,429

    Default Re: Need Help with History Tables

    Mike

    This zip file of your sample is easier to deal with.

    Email me and we should talk.a5db.zip
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

Similar Threads

  1. History Table...
    By cavj1 in forum Application Server Version 9 - Web/Browser Applications
    Replies: 12
    Last Post: 09-25-2009, 04:19 PM
  2. Find History
    By Peter.Greulich in forum Alpha Five Version 8
    Replies: 1
    Last Post: 01-24-2009, 12:20 PM
  3. Alpha History
    By MikeData in forum Alpha Five Version 9 - Desktop Applications
    Replies: 7
    Last Post: 11-26-2008, 12:30 PM
  4. Changing history
    By Ian Copestake in forum Alpha Five Version 4
    Replies: 10
    Last Post: 10-28-2001, 02:02 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
  •