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

Finding Missing Data

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

    Finding Missing Data

    I'm seeking advice on the best way to do the following:

    I have a database that has a table which contains student demographic information, i.e., Student_ID,Fname, Lname, Address1,CountyCode, City, State, Zip, etc. All total there are 25 different fields of information collected.

    What I am wanting to do is to loop through the records (about 17,000) and if there is a piece of information missing (can be anything up to the 25 fields), generate a report that has the Student_ID and the name of the field that is missing data, i.e., CountyCode or Zip. Thus creating a Quality Control Report.

    I hope this makes sense, if it doesn't please let me know.

    Thanks in advance for any and all help.

    Ben

    #2
    Re: Finding Missing Data

    Hi Ben,

    Just as a matter of interest, how do you intent to fix the records with empty fields?

    I assume that certain fields are not empty, like the Student_ID, Fname and Lname. So my next question is, how do you want the records presented?

    eg. Browse or Report?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      Re: Finding Missing Data

      Keith, I would like a report that displays the Student_ID and any of the missing fields so that it can be passed on to the data entry team to look up and fill in the missing data.

      Thanks,

      Ben

      Comment


        #4
        Re: Finding Missing Data

        Originally posted by bluize View Post
        Keith, I would like a report that displays the Student_ID and any of the missing fields so that it can be passed on to the data entry team to look up and fill in the missing data.

        Thanks,

        Ben
        Several ways to do this. Here is one way.

        Create a report based on the table in question. Drop the Student_Id field onto the report.

        For the filter use the isblank() function. i.e.

        Code:
        isblank("student_id") .or. isblank("name") .or. isblank("address") .or. isblank("city") .or. isblank("state")...
        This will give you a report listing all of the student_ids that are missing data. However this does not satisfy your condition of also indicating on the report what data is missing. For this element I would use a calculated field on the report.

        for the calculated field I would use something similar to this.
        Code:
        vMissingDataC = if(isblank("Student_Id"),"Student Id","") + " " + if(isblank("name"),"Name","") + " " + if(isblank("address"),"Address","") + " " + if(isblank("city"),"City","") + " " + if(isblank("state"),"State","")..."
        You will need to replace the field names in both the filter and the calculated field equation with your actual field names.
        Andrew

        Comment


          #5
          Re: Finding Missing Data

          Probably the simplest thing to try is to add a memo field and use a global update to append a flag to the memo (describing the missing field). Wipe the field first then go through each field appending the previous flag value and adding a new flag if applicable. Then just create a report that queries the memo field being populated.

          The update would be something like this...

          Code:
          a_tbl = table.open("tbl_test")
          
          update.fields = 4
          update.field1 = "MISSING_FLAG"
          update.expr1 = "''"
          update.field2 = "MISSING_FLAG"
          update.expr2 = "if(isblank('Fname'),'FNAME MISSING',MISSING_FLAG)"
          update.field3 = "MISSING_FLAG"
          update.expr3 = "if(isblank('Lname'),rtrim(Missing_Flag)+crlf()+'LNAME MISSING',MISSING_FLAG)"
          update.field4 = "MISSING_FLAG"
          update.expr4 = "if(isblank('Address1'),rtrim(Missing_Flag)+crlf()+'ADDRESS1  MISSING',MISSING_FLAG)"
          
          a_tbl.update()
          Chris Tanti
          Technical Support

          Nuance & Fathom Ltd - The data-driven marketing agency

          Comment


            #6
            Re: Finding Missing Data

            Maybe a a simple calculated field on the report will do the trick. something like:

            Case(isblank("zip"),"Zip code missing - ",isblank("Countrycode"),"country code missing - ",isblank("telephone"),"Telphone is missing") etcetc

            Then you would need to adopt a method to only show those records where the the calculated field is not blank - not sure if Alpha can do that - but someone will know - 17000 records would be a big report otherwise, but I wouldn't be surprised if all 17000 had at least one missing - data entry are going to love you.
            -----------------------------------------------
            Regards
            Mark Pearson
            [email protected]
            Youtube channel
            Website

            Comment


              #7
              Re: Finding Missing Data

              Thanks everyone for clues and leads, I'll give them a try and see what shakes out. You are right, the data entry people are going to "Love Me"

              Ben

              Comment


                #8
                Re: Finding Missing Data

                You asked about fixing the problem and then go on to suggest a report.
                Did you think of just filtering the records and stepping through them to fix obvious errors first?
                Garry

                Comment


                  #9
                  Re: Finding Missing Data

                  Garry,

                  There are over 17,000 records in the database and there can be multiple fields that are missing data in each student record. The data comes in from an external school registration system and at the time of registration, some of the records are incomplete. My thinking was to generate a report showing what is missing and turn it over to the registration team who has gathered additional data on the students since initial registration.

                  Thanks,

                  Ben

                  Comment


                    #10
                    Re: Finding Missing Data

                    Or use this. I haven't timed it on a really big table but 17,000 records shouldn't be a big deal. The Clients table I used it on (a long time ago) only had about 600 records.

                    Just put in your own table name and field names and run it.

                    NOTE: This one only works for character fields.

                    Code:
                    tablename = "Clients"
                    tp = table.open("clients")
                    fld_list = <<%list%
                    Addressf
                    Cityf
                    Statef
                    Zipf
                    Phonef
                    Faxf
                    Emailf
                    Trkg_Mthdf
                    %list%
                    fcnt = w_count( fld_list, crlf() )
                     
                    ID_field = "Client_nof"
                     
                    ndx = tp.index_primary_put("")
                    tp.fetch_first()    'JIC
                     
                    msng_list = "List of Missing Data in the " + tablename + " Table as of " + dtoc(date(),"6-") + " @ " + left(time(),5) + crlf(2)
                     
                    WHILE .not. tp.fetch_eof()
                        this_line = ""
                        FOR qx = 1 to fcnt
                            IF eval( "tp." + word( fld_list, qx, crlf() ) ) = ""
                                IF this_line = ""
                                    'Use this line to keep it to fewer pages.
                                    'this_line = trim(eval( "tp." + id_field )) + ":  " + word( fld_list, qx, crlf() )
                                    'Use this line to make it easier to read.
                                    this_line = trim(eval( "tp." + id_field )) + ":" + crlf() + space(5) + word( fld_list, qx, crlf() )
                                ELSE
                                    this_line = this_line + ",  " + word( fld_list, qx, crlf() )
                                END IF
                            END IF
                        NEXT
                        IF this_line <> ""
                            *concat( msng_list, this_line + crlf() )    'Do NOT use Concat_lines() - it's way too slow!
                        END IF
                        tp.fetch_next()
                    END WHILE
                    tp.close()
                     
                    dlg_text = <<%dlg%
                    {ysize=.3}{units=F}{sp};
                    {stretch=height,width}[%mwk%.100,15msng_list];
                    {sp};
                    {stickto=bottom,center}{justify=center}<*20Close> <20Show in WordPad>
                    %dlg%
                    DIM dlg_result as C
                    dlg_result = ui_dlg_box( "MISSING DATA", dlg_text, <<%code%
                    IF a_dlg_button = "Show in WordPad"
                        save_to_file( msng_list, a5.Get_Path() + "\Missing_list.txt" )
                        'Note, I use WordPad to view .txt files. Default for others is usually NotePad or Word.
                        sys_open( a5.Get_Path() + "\Missing_list.txt" )
                    END IF
                    %code%)

                    Comment


                      #11
                      Re: Finding Missing Data

                      Thank you Cal, I'll check it out.

                      Ben

                      Comment

                      Working...
                      X