# Invoices for a year,but how do i get quartertotals

This topic is 6608 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

• Newbies

Hey,

I made an invoice/timebilling thing in FMP.

I'd like to have quarter subtotals. How do i do that?

Thanks

##### Share on other sites

You could create a calc. field that uses the date field to assign an invoice to a particular quarter. Once you have a field that categorizes records by quarter, you can make a standard subsummary report where the quarter field is the break field. You still need to define a summary field that is the total of the invoices. You can use the new layout/report wizard to make the subsummary report at that point if you don't want to add the layout parts yourself.

##### Share on other sites

Here's a quick and dirty calculation that will give you the quarter and year field that you can do finds and sorts on:

Case(

Month(Date) = 1 or Month(Date) = 2 or Month(Date) = 3,1,

Month(Date) = 4 or Month(Date) = 5 or Month(Date) = 6,2,

Month(Date) = 7 or Month(Date) = 8 or Month(Date) = 9,3,

Month(Date) = 10 or Month(Date) = 11 or Month(Date) = 12,4) & Right(Year(Date),2)

...I would bet one of these other folks could come up with a shorter, more elegant calculation.

##### Share on other sites

Quarter =

Int ( ( Month ( Date ) - 1 ) / 3 )

This yields the numbers 0, 1, 2 or 3, so if you want the correct label, add 1 to the result:

Int ( ( Month ( Date ) - 1 ) / 3 ) + 1

or

Int ( ( Month ( Date ) + 2 ) / 3 )

In v.7, use Div() instead of Int ( x/y ).

For correct sorting, I would place the year before the quarter, and use the full 4 digits.

##### Share on other sites

Very nice, comment. I knew someone would do it. Now I just need someone to pay off on my bet.

##### Share on other sites

BTW, what does "these other folks" mean? I trust this is something good?

##### Share on other sites

One thing I have learned in all my years of computer programming - no matter how much you think you know, there is always someone, somewhere, that knows more than you do. an old UNIX instructor I once had told me that. He also said to find those folks and decompile their brains. If you don't learn something new every day, you're not doing it right.

That's who "these other folks" are, including you, comment. I learned something new from you.

##### Share on other sites

See, now you've made me blush.

As for decompiling my brain - forget it.

##### Share on other sites

I have dibs on comment's brain!

##### Share on other sites

This topic is 6608 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account