July 11, 200718 yr 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!
July 11, 200718 yr Hi you'll need a custom function or a calculation involving a repeating field. How many values can hold that list ?
July 11, 200718 yr 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.
July 11, 200718 yr Author 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.
July 16, 200718 yr Hi comment I was waiting for you on this post : P.S. 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, :
July 17, 200718 yr 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. :
July 17, 200718 yr 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
Create an account or sign in to comment