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

incorrect formula

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

    incorrect formula

    I want to find out the total number of men who came to our center between 2 dates. This is what I figured out,but when I try to insert this formula into a report foooter, it tells me the function is incorrect. What am I doing wrong? Thanks
    tablecount("Intake.dbf","Gender='M'") .AND.tablecount("Daily.dbf","between(Daily"Date,{"+dtoc(date1)+"},{"dtoc(date2)+"})")

    #2
    RE: incorrect formula

    Now that I look at it, I can see it is wrong, but I still don't see how to get a total of all the records that have to meet 2 requirements. Ed

    Comment


      #3
      RE: incorrect formula

      If you are trying to add the two counts together I think the only problem is that

      between(Daily"Date

      should be

      between(Daily-"Date

      If you are trying to count items common to both tables, we have some more work to do.
      There can be only one.

      Comment


        #4
        RE: incorrect formula

        Actually combining the two counts would be

        + tablecount("Daily.dbf","between(Daily-"Date

        but I don't think that's what you want.....
        There can be only one.

        Comment


          #5
          RE: incorrect formula

          Thanks for your thoughts. What I want to to find the total of all the people who are in both groups at once, i.e. men who got service between June and October of 2004. I think I need to take out the second tablecount(), but writing the filter from a parent table for the gender and the child table for the date is making my brain hurt. Thanks Ed

          Comment


            #6
            RE: incorrect formula

            You can't use tablecount() on two tables at once or even a set, so don't waste your time.

            You might post a small sample of the two tables to experiment.
            There can be only one.

            Comment


              #7
              RE: incorrect formula

              Thanks for your interest. This is a very simple database we use at our Homeless drop-in center. The parent table is demographic, name, age, race, education level, etc. There is a one field child table that just has the dates that each person comes to the center. I would like to do a report that says that for a span of dates, that we had so many Hispanics, so many African-Americans, so many Men, so many women, etc. Tablecount won't work on a set. I can write a whole series of reports that group on race or sex or whatever and print totals. It just seems that I should be able to have one report that where I can place fields that summarize the demographic data for a date span. Ed

              Comment


                #8
                RE: incorrect formula

                Edward, this will be very easy if you create a new set using the same tables. Invert the present relationship. Use one to one link. Base your report on the new set. Filter it the way you need. -- tom

                Comment


                  #9
                  RE: incorrect formula

                  You must have gathered that logic is not my strongest suit. I understand that inverting the relation allows me to filter the records by date, but I still can't use tablecount() to get the total Hispanics or females or whatever. What do I put in the report footer to get those totals or do I have to use count()on groups in the report? Thanks for the help. Ed

                  Comment


                    #10
                    RE: incorrect formula

                    Make a calculated field, something like

                    c_count = if(somefield = Hispanic .AND. somedate "= var-"date1 .AND. somedate "= var-"date2, 1, 0)

                    Then in the report footer, you can have a

                    calculated Total on c_count.

                    Comment


                      #11
                      RE: incorrect formula

                      Does that work :)

                      Comment


                        #12
                        RE: incorrect formula

                        Ed, on closer reading of your description of your ultimate goal I think you're going to have to do considerable processing before you generate a consolidated report of the type you have in mind. To compile these statistics you will have to step through all the records in the inverted set more than once. Each time you compute your totals you could copy them to a separate table. This separate table would be the foundation for the report. At present you can't do the kind of totals you need simply by grouping your records or by filtering them. Your categories overlap. Hispanics include females and males, for example. Doing this with a series of carefully crafted tablecount() expressions might be feasible, but I'm not sure you gain much doing it that way. Alpha is still going to have to step through the table a bunch of times in order to compute all the totals.

                        -- tom

                        Comment


                          #13
                          RE: incorrect formula

                          Tom, I am disturbed by your answer. What I need seems like the most ordinary of database tasks. I just want a series of totals of the limited number of possibilities in each field. It is sort of like a crosstab, only there seems to be no field I can use there as the central field as in the example. Forgetting about the complexity of the date field, should there be some simple way of putting this together? Ed

                          Comment


                            #14
                            RE: incorrect formula

                            Edward,

                            Did you not see my response in Msg ID: 79971?

                            Just make separate calc field for each condition you need to
                            "count" and have a total on each separate calc.

                            Comment


                              #15
                              RE: incorrect formula

                              Mr. Davidson. I was responding to Tom Cone's answer, which seems to suggest that these ordinary tasks are not something that Alpha can readily do. I will certainly be trying your idea and I am eager to make it work. Ed

                              Comment

                              Working...
                              X