• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

Can Multiple Globals be used? or how do I?

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?
1 Solution
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
a summary report is probably what you need...
ErootsAuthor Commented:
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?

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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.

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.
ErootsAuthor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now