Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Summarizing current month and year-to-date

Featured Replies

I have a table of contributions containing the following fields:

Contributor_ID

Date

Amount

I'd like to prepare a report with three columns, one row per contributor:

Contributor_ID.....CurrentMonthTotal.....YearToDateTotal

Is there any way to do this simply, using Summary fields, Subsummary layout parts, etc.? Or do the two overlapping control breaks make this impossible without using temp tables or something?

Thanks,

Chap

Look at the file Søren pointed to yesterday, Here

You can't do this straightforward in the same summary report, because each requires a different found set. However, you can do the YTD as a summary, and the MTD through a self-join relationship (same ContributorID AND within the current month).

Note however, that relationships ignore the found set, so if you need to omit some records that meet the above criteria, you'll have to also filter them out of the relationship.

You need a found set for the whole year and a calculated field to summarize month-to-date values. This field needs to evaluate to zero or empty for all records that don't belong to the current month. Assuming we always use the today's date the field should be like:

Let( [

  today = Get( CurrentDate );

  beginning of this month = today - Day( today ) + 1 ];



  Case( beginning of this month <= Date;

    Value ) )

Since the breaker is the person, could the same be done with YTD:


Let([

      today=Get ( CurrentDate );

      FirstDayOfThisYear  = Date ( 1;1;Year ( today ) )];



      Case(FirstDayOfThisYear  ≤ theActualDate;

     theValue))

... am I correct? This means you then can constrain the found set omitting all "Hoosewrenches" - doesn't it?

--sd

Edited by Guest

Yes, come to think of it, it could be calculated. I haven't tested this but I believe it could also be done by:

GetSummary ( Amount ; cMonth )

provided that records are sorted by Contributor_ID and cMonth, and that the sub-summary by Contributor_ID part is trailing.

  • Author

Thanks for all the suggestions. I ended up creating two unstored calcs; one for contributions in the current month, and one for contributions in the current year, and I created two corresponding summary fields. As Soren pointed out (once I got past the "Hoosewrenches" :B ), this allowed me to omit records based on arbitrary criteria. Since I decided I didn't want to list contributors that hadn't donated in the current year, this was very straightforward.

The YouTube video was very useful, btw -- it rammed home for me what a summary field is, and is not.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.