Solved

Can Multiple Globals be used? or how do I?

Posted on 2008-06-12
6
236 Views
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?
0
Comment
Question by:Eroots
6 Comments
 
LVL 9

Expert Comment

by:jvaldes
Comment Utility
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
0
 
LVL 28

Expert Comment

by:lesouef
Comment Utility
a summary report is probably what you need...
0
 

Author Comment

by:Eroots
Comment Utility
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?

0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 28

Expert Comment

by:lesouef
Comment Utility
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.
0
 
LVL 10

Accepted Solution

by:
webwyzsystems earned 400 total points
Comment Utility
Hi,

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)

Now, go to DEFINE DATABASE, RELATIONSHIPS

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
etc...
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
AnnualMembersYear1_calc=COUNT(CurrentMembers::IDKEY)
AnnualMembersYear2_calc=COUNT(PastMembers::IDKEY)
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.
eg:
g_comparisonYear1
AnnualFeesYear1_calc
AnnualMembersYear1_calc

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.
eg:
g_comparisonYear2
AnnualFeesYear2_calc
AnnualMembersYear1_calc

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

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.
0
 

Author Closing Comment

by:Eroots
Comment Utility
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.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
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…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

9 Experts available now in Live!

Get 1:1 Help Now