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

Grouping and summing a list

Featured Replies

Hi there...! Calling all Custom Function wizards I need your help!!

 

I am trying to make a custom function that can take a list of values like so:

 

Bob|5

Mary|3

Anne|3

Bob|5

Frank|1

Bob|5

Anne|2

 

 

And turn it in to a group summed list like this:

 

Bob|15

Mary|3

Anne|5

Frank|1

 

Sorry, this is a non-question. The real problem lies elsewhere. Why don't you use records and fields to store your data? Then the problem of summing and grouping becomes trivial.

  • Author

Cool! Thanks Comment!

Cool! Thanks Comment!

 

No problem, glad I could help.

Cool! Thanks Comment!

 

Here is the function anyway in case anyone else is searching!:

 

 

That function, as written, can't work.

That function, as written, can't work.

 

Why such a negative attitude?

What function? Can't see it.

  • Author

It has gone at the request of the author

It has gone at the request of the author

 OMG,  now  you got my curiosity up,  what was the name of this custom function

Why such a negative attitude?

 

There was an undefined $var in that custom function ( at least )

There was an undefined $var in that custom function ( at least )

 

Look closer …  :smile:

 

In fact, I learned this from you, though not in this exact manner.

GroupAndSummarize_eos.fmp12.zip

Sorry, this is a non-question. The real problem lies elsewhere. Why don't you use records and fields to store your data? Then the problem of summing and grouping becomes trivial.

 

Well, in comparing whether to use a proper relationship with records versus a custom function, my vote is the relationship. 

And I have to say that I'm surprised that other seasoned developers on this thread aren't supporting the same concept.

Look closer …  :smile:

 

I did.  :idot:
I have to say that I was wrong but also that your CF shows a difficult sequence, although the result is nice. :flowers:

Create an account or sign in to comment

Important Information

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

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.