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

YTD total of a field

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

    YTD total of a field

    I have a data base that tracks donations to our organization. The donor table is in a one to many relationship with with the donation table. Each donor's donation is recorded in the donation table through the year. The "donation_total" field is the amount of each donation received. Each donor will make several donations through the year. I want to create a calculated field that shows each donor's YTD donations. What expression could I use to do that?

    #2
    Re: YTD total of a field

    Create a calculated field

    ty_yes= if(year(your_date_field) = year(date()),donation_total,0)

    Then drop that calculated field in the appropriate footer and specify total.

    You might want to create an inverse of your present set with donations as the parent linked one to one to donors.
    There can be only one.

    Comment


      #3
      Re: YTD total of a field

      Stan,
      I get an invalid or incomplete expression. Here is what I did: expression.JPG In my first post I identified the total field as "donation_total" The correct name is "Total_Donation" as in the attached clip. The date field is: "Donation_Date".
      Last edited by dayspring; 10-02-2012, 05:27 PM.

      Comment


        #4
        Re: YTD total of a field

        I wasn't clear.

        Define the calculated field for the report.

        report calc.png
        There can be only one.

        Comment


          #5
          Re: YTD total of a field

          Stan:

          Thanks for your quick reply. I am sure you are used to dealing with people that actually have an idea what they are doing. I am trying to replace a dbase written in Lotus Approach. I was wanting to create a form with the YTD field in the form as shown in the clip, Form.JPGrather than a report. Is that possible in Alpha?

          Comment


            #6
            Re: YTD total of a field

            Possible yes but difficult to explain. Can you attach a sample of your database or at least the set upon which the form is based?
            There can be only one.

            Comment


              #7
              Re: YTD total of a field

              Stan:

              Here it is: The field that I want to create the expression for is the "Total_Year" field located in the "donation" table. I want it to give the YTD total for each individuals donations from the "Total_Donation" field. I want the "Total_Year" to appear in the "Donations Browse" Form so I can see, not only the date and amount of each donation, but also their total for the year. Thanks for your help with this. It is way beyond my expertise.

              Roger
              FILE.ZIP

              Comment


                #8
                Re: YTD total of a field

                Roger, what total do you want to display if donations are from different years?
                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


                  #9
                  Re: YTD total of a field

                  I basically save the table for each year in a file and then erase the data in the donation table and start over with a clean copy for the new year. So there will only be donations for one year. We use the information for receipt purposes and do not need to compare the data from one year to another. Any comparisons of one year to another can be done in a seperate accounting program that we use.

                  Comment


                    #10
                    Re: YTD total of a field

                    Hi Roger,

                    Have a look at Alphasports Invoice and see how the Invoice Items are totaled on the form.

                    In your case I think it would be total = total(donation_Items->Total_Donation,GRP->Id_Number)
                    Last edited by Keith Hubert; 10-03-2012, 06:50 AM.
                    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


                      #11
                      Re: YTD total of a field

                      Keith,
                      Still getting invalid or incomplete expression. I tried several different combinations but the only thing close that does work is total(Donation->Total_Donation) that gives the total for all donations for all donors for the year. I need an expression that gives me the total for each donor.

                      Roger

                      Comment


                        #12
                        Re: YTD total of a field

                        Hi Roger,

                        Did you look at the Alphasports Invoice sample?

                        Have a look at attached.

                        I changed link in set and used different field to get totals as per your screen shot.
                        Attached Files
                        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


                          #13
                          Re: YTD total of a field

                          Keith,

                          What you have there does work but it is not letting me add additional donations to an individual. If you go to the Donation form and click on the ID number it does a lookup for the different donors and then enters their ID number and name. You can go ahead and enter your new donation and when you save it the ID number changes to a different number and it will not allow you to change it back. Also in the Trace Window it is showing several error codes:
                          Warning [1]: Error(s) opening rules for field: TOTAL_YEAR
                          Warning [2]: Error adding calculated rule to database engine.
                          Warning [3]: Error(s) opening rules for field: TOTAL_YEAR
                          Warning [4]: Error parsing 'calc' rules expression.

                          Any ideas?

                          Roger

                          Comment


                            #14
                            Re: YTD total of a field

                            Hi Roger,

                            You created the form as a duplicate but did not change any of the settings. eg: you have Add New Record button, but in properties new record is restricted. You asked how to get the total to show on the form, I suggested you look at Alpha Sports, did you do that?

                            Start with a blank form and see if you get the same errors.
                            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


                              #15
                              Re: YTD total of a field

                              Roger,

                              Unzip the attachment to an empty folder. I've modified your form (Donations Browse) to display the donation total for each individual.

                              In your scenario there's no reason to filter the records down to current year donations, since you're doing that manually each year. By definition, all donation records are in the current year.

                              In two separate cases you've used the same name for a table and for a set. I strongly recommend against doing this. Use distinct names. For everything.

                              You will notice that the computed total for each individual is NOT in the browse object on your form. For reasons that aren't clear to me you have asked that the individual total be shown in the browse. This cannot / should not be done. Each row in the browse control represents a single physical donation record. In order to display the computed total for a given individual you'd have a column labelled something like "YTD total", and then the same computed value would appear on each row. This is horribly inefficient and is apt to be confusing to the user. Instead of a column of identical numbers, each of which would have to be separately computed, just put the ytd total on the form OUTSIDE the browse object.

                              If you're really talking about displaying a "running total" on each row of the browse that's a wholly different matter, and something you have not yet requested.

                              Lastly, I've removed your "new record" button from the form. Your form is based on a set containing two tables. Alpha Five stores data in tables not in sets. You, as designer of the form, must provide for CRUD functionality for both tables. (Create, Read, Update, Delete) This cannot be handled adequately with a single button.

                              Good luck with your project.
                              Last edited by Tom Cone Jr; 10-03-2012, 06:35 PM.

                              Comment

                              Working...
                              X