Can Multiple Globals be used? or how do I?

Posted on 2008-06-12
Last Modified: 2010-05-18
Here is my dilemma:

I am trying to create a layout which is a generated report for a large company. On this layout There is general data fields regarding membership dues that compare the current year to the prior year.

IE "Dues Paid 2008" "Dues paid 2007" "difference in dues" "number of new members" "number of members lost" etc...

I am usually able to find everything in find mode to plug in the numbers in an excel version of the layout, but the client we are developing for is insisting on a "one or two step" process, where they input "year" into a field and click "generate report".

Is there a way to use multiple globals, or do you have suggestions on what to use (IE calculation fields, scripts, conditional formatting, etc..) to achieve this?
Question by:Eroots

Expert Comment

ID: 21771314
In filemaker you can do anything you can do from the menu in a script. If you can't figure out how to  do it with calculations you may want a script that does the same work then stores the data in a global field and then display the results in a final layout that properly expresses your results.

I don't know enough about your database to understand what you are trying to report.

For example you can do a find that meets a certain criteria and if you wanted to store the number of records that meet that criteria you would set field (g_records;get(foundcount) etc... This will store the number of records in a global called g_records. g_records should be set to number type and global storage
LVL 28

Expert Comment

ID: 21771963
a summary report is probably what you need...

Author Comment

ID: 21772035
the trouble with summary fields is that they can only be used with one global, I could do summary fields if I was able to set two globals (IE 2007 and 2008).

Jvaldes- I like your script idea, is there any way to chain multiple "set globals" together in one script so that I could sum 2 different fields with two variables in the one script?

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

LVL 28

Expert Comment

ID: 21773215
I was not talking of summary fields but summary reports, ie using sub-summaries parts in layouts, which can summarize any table by breaking on one or more given fields, and thus get several summary values based on a field, year in your case.
LVL 10

Accepted Solution

webwyzsystems earned 400 total points
ID: 21852627

This very simple to accomplish in Filemaker Pro. I am assuming you are on FMP 7.0 or better.
Here is a single step process, that will allow you to add a very slick comparison layout to your system. I had to make some guesses as to how your system is designed...please adapt to suit.
Remember that this is examples only to get you going.

First - define a new table: REPORT_GUI
In that table there are going to be several new fields, but we will start with some globals:
g_comparisonYear1, number, global storage
g_comparisonYear2, number, global storage

In your data tables (the tables you are doing your searches on) you will need to define a calculation field to narrow down the date. For example:

In PAYMENTS, your calculation might be: transactionYear=Year(transactionDate)
in MEMBERS, your new memberships calculation might be: signupYear = Year(dateJoinedAsMember)
in MEMBERS, your lost members calculation might be: cancelYear=Year(dateOfLastRenewal)


Start creating your relationships: They will be something like
CurrentFees -> REPORT_GUI::g_comparisonYear1 = PAYMENTS::transactionYear
PastFees-> REPORT_GUI::g_comparisonYear2 = PAYMENTS::transactionYear
CurrentMembers-> REPORT_GUI::g_comparisonYear1 = MEMBERS::signupYear
PastMembers-> REPORT_GUI::g_comparisonYear2=MEMBERS::cancelYear
keep on creating relationships until you have got all your fields setup for the big report.

Go into the new table REPORT_GUI. Build the matching calculation fields:

AnnualFeesYear1_calc = SUM(CurrentFees::transactionAmount)
AnnualFeesYear2_calc = SUM(PastFees::transactionAmount)
AnnualDifference_calc = AnnualFeesYear1_calc  - AnnualFeesYear2_calc
MembersDifference_calc=AnnualMembersYear1_calc - AnnualMembersYear2_calc

Now, go back to the REPORT_GUI layout that was automatically created when you built the new table.
Just use the FORM view, and make it big. You are going to create 3 columns here, but manually. First column is YEAR 1, second column is YEAR 2, and third column would be your comparison results.

At the top of column 1, drop the field g_comparisonYear1. The user will enter the first year to compare.
Under that, place your new calculation fields.

Then, create column 2 - by putting the field g_comparisonYear2 at the top. The user will enter the second year to compare against. Under that, place your new calculation fields.

Finally, column 3 will contain your difference calculations.
COMPARISON RESULTS (just a title here)

And that's it!

All the user does is type in the years they wish to compare at the top of the columns - and boom it's all done for them. No mess, no fuss, no scripts....just easy!

One caveat: This tends to get rather slow once you get over 1 million records in the data tables. I know this from direct, hard experience. So if you are dealing with millions of transaction records, you will need to do this a different way.

Hope this helps,

Rob A.

Author Closing Comment

ID: 31466545
I was trying to avoid the creation of new fields and a table relative to one report, but depending on how things go, this thing might be the best option for it.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In a recent question ( here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now