Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

for want of a better way to describe it.

Can someone find a good solution to this problem?

The values contained in a field in a related table might look something like this, if listed:

1 2 3 4 7 9 10 11 12

I want this:

1-4, 7, 9-12

I have actually succeeded, using a looping script and a calculation field, but the calculation is very cumbersome. Also I wonder if it couldn't be done without a script - just with a calculation.

Any ideas?

Thanks in advance!

Posted

Hi

you'll need a custom function or a calculation involving a repeating field.

How many values can hold that list ?

Posted

You would proabably need the the following functions

List() - returns a delimited list of related values

ValueCount() - gets the total number of values in a list

GetValue() - gets a specific value

You could use all these together and accomplish what you are looking for.

Let(

[

numberCount = List(relatedField);

middle = floor(numberCount/2) // get the middle and round down... you could round up with upper

];

// would need to create a recursive function here to display values from 1 to middle - 1

// then display middle

// then use that same recursive function here to display the rest

)

This is of course assumes you have one value per related record. It's a little complicated. I can probably put something together for you a little later or someone else may come along and finish it out for you.

Posted

raybaudi: the list can be long or very short. Anything is possible.

There is only one value per related record, but not a fixed number of related records.

I'd be very grateful if a solution could be found that doesn't use a script. I needed the script to create the groups of consecutive numbers but I really hate to have to make the user push a button to get the result.

Posted

Hi comment

I was waiting for you on this post :

P.S.:P there is the same problem that I had with situation like this:

1

2

3

4

6

7

The CF returns this result: 1 to 4, 6, 7, :

Posted

Mhm. I don't see it that way. To me, the "to" is a placeholder for SKIPPED values - and nothing is skipped between 6 and 7.

I might consider getting rid of the trailing ¶ in the premium version of the function. :

Posted

To me, the "to" is a placeholder for SKIPPED values

Yes, this is in fact an opinion matter :

BTW: if the premium version could evaluate also my opinion... :P

This topic is 6399 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.