Jump to content
Claris Platform 2023 Roadmap ×

Adding Additonal Subsummary Part & Calc Field

This topic is 6818 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a database consisting of many records and layouts. One of my layouts that I use for printing has a subsummary part. Each Record in the database has a number ie; 1m1, 1m3, 2m1, 2m2. When I go to this layout for printing which has the subsummary part it puts a heading over the records in that series. ie; Group 1: followed by records 1m1, 1m2; Group 2: followed by records 2m1,2m2. The group number is derived from the first number of the record.

What I'd like to do is add another piece of data to that sub summary. For each group there is a version number that the user manually enters on a different layout. I'd like to have a calc that reads which group number is in the sub summary and then displays the corresponding version next to it.

I have made a little headway on my own...I think. I created a new field called "Reel Versions" and put the following calc into it:

Case ( Reel = 1 ; Reel 1 Version ;

Reel = 2 ; Reel 2 Version ;

Reel = 3 ; Reel 3 Version ;

Reel = 4 ; Reel 4 Version ;

Reel = 5 ; Reel 5 Version ;

Reel = 6 ; Reel 6 Version ;

Reel = 7 ; Reel 7 Version ;

Reel = 8 ; Reel 8 Version ;

Reel = 9 ; Reel 9 Version ;

Reel = 10 ; Reel 10 Version ;

"none" )

The idea is that it reads the number that is already retrieved and displayed in the subsummary part. (ie; Reel Number). So in theory it would read that number and then if it equals a number (1-10) that new field will display the appropriate version in the subsummary part. With the calc as it is I am able to retrieve the version for the first Reel (or group of records) then when it goes on to Reel 2 and 3 etc. it retrieves nothing.

Anyone know what I'm missing?

Link to comment
Share on other sites

The problem that you are having is because there is no relationship between your group and the associated "reel version" that the user will key in on the other layout. To solve this, you can either create another "reel version" table keying on the fieldl group number.

Then you calculation field should work when you key on the correct related field.

Link to comment
Share on other sites

Each of the Reel Version fields only has data in the first record. Subsequent records do not use its data for the calculation. They use the values from their own fields, which are empty.

You either need to make them globals, so that the same values are available for every record, or just use one global with ten repetitions (I'll call it gRep_Reel Versions) and make Reel Versions a calculation of

Case( Reel >= 1 and Reel <= 10; gRep_Reel Versions[Reel]; "none" )

Link to comment
Share on other sites

To make it work you only need two fields. One is a global field, Queue named gRep_Reel Versions. The other is your calculation field. this should allow the user to fill in the data on the home page.

Case( Reel >=1 and Reel <= 10; GetRepetition(gRep_Reel Versions;Reel); "none" )

Under field format, you can format the global field to show reps 1-10, or have 10 copies of the field on the layout each one showing reps 1-1, 2-2, 3-3, 4-4, etc.

This should solve your problem.

Link to comment
Share on other sites

See attached.

Field[rep] is the same as GetRepetition( Field; rep ) in FM 7. I prefer the shorthand version.

The field must be a global in order to be accessible to all records. You can't easily use record 1's data for all other records. So you should put this field on a layout that only displays one record and it doesn't matter what that record is, for example, a main menu.


Link to comment
Share on other sites

One last thing. Seems silly but I want to restrict the type of data the user can put in the fiedl as a number. As of now if you input words instead of a number you get a "0" on the report. How would I either allow the user to enter words or restrict the entry to numbers only.

Link to comment
Share on other sites

This topic is 6818 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.