Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Set Linking Field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Set Linking Field

    Have a master table listing patients, with each patient having a unique identifier, "identifier".

    Have a child table of doctors. Each doctor,naturally, can serve multiple patients, and each patient can have multiple doctors.

    Each doctor has a field which lists patients identifiers, separated by commas, "PtNumber", e.g. 11111, 22222, 33333, etc.

    I wish to link on the fields "identifier" and "ptNumber".

    The linking is not working. I know you can't have a calculated field for linking, but I'm stumped to figure out how to link. I've tried using containsi() function.

    Obviously, the report for the doctors prints fine as a stand-alone report, but the set based report will not print, when filtered for the patient indetifiers.

    Thanks in advance.

    #2
    RE: Set Linking Field

    I don't think you're going to have much success with this approach. The main problem is that you're trying to keep multiple IDs in a single field, seperated by commas.

    What you really need is three tables.

    1. Doctors.dbf, with a Dr. ID, name, office address, etc. Probably everything that you have now with the exception of that single field listing multiple patients.

    2. Patients.dbf. I think you're probably in good shape here, too.

    3. Dr_Patient.dbf. This is the "missing link" that you need. It's most minimal form has two fields:
    - Dr_ID
    - Patient_ID

    Now you have everything you need for your sets.

    To get a list of doctors with all their patients, you make a set with Doctors as the parent. Add a one-to-many link to the Dr_patient.dbf, based on Dr_ID. Then add a one-to-one link from Dr_patient.dbf to Patient.dbf, based on Patient_ID.

    Reverse this set design setup for a list of patients and their many doctors.

    Hope this helps.

    - Steve
    -Steve
    sigpic

    Comment


      #3
      RE: Set Linking Field

      Steve, thanks for your help. I'll give it a try. As a temp workaround, I took the source doctor's table, and created a new table, each time I run the report, sorting out the patient's names, using containsi() function.

      It works okay, but, does slow the report down. After each report is printed, I'm deleting the records in the new table, so it's available for the next report.

      Comment


        #4
        RE: Set Linking Field

        Al:
        "Each doctor has a field which lists patients identifiers, separated by commas, "PtNumber", e.g. 11111, 22222, 33333, etc. "

        I guess that misses the whole essence of "relational database" and "one-to-many" links !! Instead of having multiple ptNumber's listed in one field separated by comas, what you should have is a set with the doctors table as the parent, linked to the patients table with PtNumber on a 1-to-many link.

        "I know you can't have a calculated field for linking,"
        Yes, you can, but it has no application here.

        What you need is minor modification to what you already have: the same 2 tables you have, doctors and patients, just add PtNumber as a field in the doctors table and use it for linking, and two sets each with a 1-to-many link:
        a-One set will have the doctors table as the parent
        b-The other set, a "reverse set" will have the patients table as the parent.


        That way, when you design a report based on the first set, it will show all the patients for each doctor and when you design one based on the second, it will show all the doctors for each patient.

        Gabe

        Comment


          #5
          RE: Set Linking Field

          Thank you for your reply.

          I did try what you suggested and it did not work.

          According to the A5 documentation, calculated fields cannot be used for linking - and apparently that's so, since it does not work.

          However, Expressions can be used for a composite linking field - different than a calculation.

          The calculation I was using, for the linking field, was containsi("PtNumber", "1111").

          I thought this still maintained the essence of a relational database.

          If I could make a subreport, without using a set, then that would solve the problem, I think.

          Thanks again.

          Comment


            #6
            RE: Set Linking Field

            Al:
            I am not sure what do you mean by using a "calculated field" to link? where does that calculated field reside?

            As you correctly stated, you could use an expression to link.

            I repeat what Steve said earlier, that you are making it harder on yourself by accumlating these idntifiers in one field. By doing that, You are not taking advantage of the relational aspect of the program and the 1-to-many links. You would be much better off having a separate record for each patient.

            By the way, you are not able to use contains() for link, because contains returns a true/false result. As such, the expression has to yield a logical result both for the parent and the child. Even if you do that, you would have to hard-code the string in the expression which limits your set to one patient!!. If you wish to change the PtNumber refernce in the expression, you could use a variable instead of hard-coding the string and I assure you, you will be looking for more trouble.

            As you see, this is going in all unnecessary circles when all you need is a properly designed set and a reverse set, period.
            Gabe

            Comment

            Working...
            X