Brian Dunning's FileMaker Custom Functions

SortAsymptote ( ordinal )

Limits an ordinal to (-1,1), for nested sort calculations

  Average rating: 4.5 (34 votes) Log in to vote

Jeremy Bante   Jeremy Bante

https://github.com/jbante/

Share on Facebook Share on Twitter

  Sample input:
List (
SortAsymptote ( 1 );
SortAsymptote ( 2 );
SortAsymptote ( 5 );
SortAsymptote ( 10 );
SortAsymptote ( 20 );
SortAsymptote ( 50 );
SortAsymptote ( 100 );
SortAsymptote ( 1000 );
SortAsymptote ( 10000 );
SortAsymptote ( 100000 );
SortAsymptote ( 1000000 );
)
  Sample output:
.4093838908503588
.5234946419594956
.6418029522161849
.7057001703361976
.752752020690265
.797235329374854
.8219094323976252
.8735578447045257
.9020610312524535
.920082701393012
.9325031743866805

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Limits the range of ordinal to fit within (-1,1). This can be useful when creating nested custom sort orders, where "child" records have a numeric sort order, but must also respect the sort order of "parent" records, so that child records with the same parent record cluster together. In these cases, this function can be used to restrict the child sort order to be smaller than the order of magnitude for the parent sort order. For example, where Parent::sort is known to contain integer values:

Parent::sort + SortAsymptote ( Child::sort ) //= Child::sortCalc

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.