Jump to content
The ORIGINAL FileMaker Community - Forum - Online Business Apps & Software Forum
larrycfc

Summing prior year sales

Recommended Posts

larrycfc

I got a slick answer to summing current year sales:

http://www.filemakertoday.com/com/showthread.php/32822-Help-with-calculated-field

 

But now as the year turns I want to do the same for last year. I tried duplicating the field and changing

If ( Year ( INV DATE=Marketing::Current Year )

to

If ( Year ( INV DATE=2015 )

 

but that doesn't work, so I must be missing a step.

Share this post


Link to post
Share on other sites
Techphan

Create a global field in the same table called gYear (Numeric). I also often create an InvoiceYear calculated field = Year(InvoiceDate). Place gYear in the header of a layout, attach a drop-down set of years (to "find") to it, and then run a script by 1) button **or** 2) script trigger OnObjectModify of the field gYear.

 

The essential script steps:

**Do script steps here (optional)**

Enter Find Mode[]

Set Field [invoice::InvoiceYear ; Invoice::gYear]

Perform Find[]

**Do script steps here (optional)**

 

Alternate script without creating an Invoice::InvoiceYear field

**Do script steps here (optional)**

Enter Find Mode[]

Set Field [invoice::Date ; Date (1;1;Invoice::gYear) & "..." & Date(12;31;Invoice::gYear)]

Perform Find[]

**Do script steps here (optional)**

 

Edit: And you will need (and probably already have) a Summary field based on the Invoice::Amount field to total the invoices.

Edited by Techphan
Clarification

Share this post


Link to post
Share on other sites
larrycfc

Just getting back to this. Thanks for the response, but I don't want to do this through a script. What I have is a layout that includes, along with client demographic info, a summary of sales activity. In a row across the bottom are boxes showing sales totals for 2010, 2011, 2012, 2013 etc. In the older fm5 version, the totals were exported from a separate transactions file and imported into this one. Now that they are different tables within the same file, I'd rather have the summaries read directly from the table. I figured I could restrict the summaries by Year of InvoiceDate.

Share this post


Link to post
Share on other sites
This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...

Important Information

Terms of Use