Can Multiple Globals be used? or how do I?

Posted on 2008-06-12
Medium Priority
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?

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 1200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

809 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