Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculation Repeating fields

Featured Replies

Hello,

Is is possible to populate a repeating calculation field with either the List function or getNthrecord function?

How populate, aren't this a bit vague to say the least? I'm afraid you must humble yourself with an explanation of context and purpose.

In my confusedness, did I for a short while, wonder if it this way around you mean:

http://fmcollective.com/2007/08/29/pseudoportals-with-alternating-fill/

...or the opposite?

You might get some inspiration to both way by this:

http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000686

...but I see you have been registered member of this forum for nearly 3 years, not that many posts though ... but by that, ought you now have realized, that this form for tutorials or help falls apart, when there's too little to go on. The answers you are likely to receive would merely be stabs in the dark, than anything particular useful!

--sd

  • Author

I have re-read my question and it seems precise and concise to me but if verbosity suits you I will enlarge.

A repeating field has a number of values.

The List function can return a number of values.

The GetNthRecord function can return a number of values.

So, is it possible by means of a calculation using either of those functions to fill in, populate, give data values to, to set the repetition values?

I thought I had read somewhere that it was possible to treat repetition values as an array something like:

Let([

Rep[1] = GetNthRecord(Contacts::First Name;1);

Rep[2] = GetNthRecord(Contacts::First Name;2)

]

But I suspect that array elements could not be used as left values. If it can be done I suspect it would use the tail recursion trick. Another thing I am not sure of is whether Filemaker puts the ASCII 29 character in the repetition field or if one creates a string with ASCII 29 separated values it becomes a repetition. I strongly suspect not.

I really don't think that I have added anything that would help a person who knew how to do this understand what I am asking,

Norman

I really don't think that I have added anything that would help a person who knew how to do this understand what I am asking,

I'm afraid I have to agree. It would help considerably if you explained what you have, and what you want to have. Abstract discussion of techniques rarely lead to anything.

A repeating calculation of:

  GetNthRecord ( Extend(X) ; Get ( CalculationRepetitionNumber ) )

can fill in repetitions with values of X from the 1, 2, 3, etc record. Note that extend is needed just to convince the calculation engine that there is need to compute all repetitions, since the field X is not a repeater in my example.

  • Author

Thank you. I'll try that.

  • Author

That worked a treat. Tell me, did you work out how to do this from the Filemaker documentation?

This is why I wanted to do this:

1. Most charting examples use fields in the same record. I wanted to chart values from the 12 records in a year.

2. Again, most charting examples need to find the maximum value of those to be displayed so scaling can be done.

Using a calculated repeating field makes this all more concise as now I have:

MonthsToShow containing my 12 values:

GetNthRecord ( Extend(Analysis::Hire Month Total) ; Get ( CalculationRepetitionNumber ) )

and MaxMonth:

Max ( MonthsToShow )

-----------------

Is it possible to use the same technique to set an array of calculation variables?

Thanks once again,

Norman

I gave almost the same answer in my post:

[

f =  Extend ( PO_LineItems::Item );

g = GetNthRecord ( f ; Get (CalculationRepetitionNumber ))

];

If (g<>”?” ; g; “”))




...in my first reply - compared with what Shawn provided you with, looking like this:




 GetNthRecord ( Extend(X) ; Get ( CalculationRepetitionNumb er ) )

However do I with the additional info you later gave, think you're barking up the wrong tree here, why is sub summary reports ignored here?

--sd

Edited by Guest
Did not intend to insult Norman, the post was reported - hence the change!

Shawn could though ...be excused for ignoring mere mortals replies ...

My apologies, I often don't bother to follow links. :)

Tell me, did you work out how to do this from the Filemaker documentation?

Well, I don't know where I learned that anymore, but the Extend() function is documented, and its proper usage is common knowledge among those using repeating fields.

I don't see any harm into using repeating fields for the case described.

  • Author

Thanks again for the help. I think I ended up with a pretty neat charting solution which is attached.

The 'ScalingFactor' variable in the field 'MonthsScaled' looks a bit odd. This is because I started off scaling the chart to the set of results. This made comparing years not work so I just made a y-axis of 500k that suited my data.

I chose the Webdings font as it looked OK and worked on both Windows and OS X.

This chart is pretty simple to implement, is FM based, is dynamic and updates quickly.

RepChart.zip

Your file is unusable. It refers to another file, Analysis, which you do not provide.

  • Author

Whoops! Sorry. Here is a new version. I hope I have done better. I was trying to produce a free standing file from the one linked with real data and did not succeed.

RepChart.zip

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.