Brian Dunning's FileMaker Custom Functions

ColumnsAcross ( listOfValues ; numberOfColumns ; columnDelimiter )

Transforms a list of values into a tabular text array.

  Average rating: 4.0 (51 votes) Log in to vote

Michael Horak   Michael Horak - Show more from this author
*COMMENT Visual Realisation

Share on Facebook Share on Twitter

  Sample input:
ColumnsAcross (
"1¶2¶3¶4¶5¶6¶7¶8¶9¶10¶11¶12";
4 ;
" | "
)



Let ( [
listOfValues = "1¶2¶3¶4¶5¶6¶7¶8¶9¶10¶11¶12";
numberOfColumns = 4;
columnDelimiter = " | "
] ;
TransposeArray (
ColumnsAcross (
listOfValues ;
Ceiling ( ValueCount ( listOfValues ) / numberOfColumns ) ;
columnDelimiter ) ;
columnDelimiter )
)
  Sample output:
1 | 2 | 3 | 4
5 | 6 | 7 | 8
9 | 10 | 11 | 12





1 | 4 | 7 | 10
2 | 5 | 8 | 11
3 | 6 | 9 | 12

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

Transforms a return-separated list of values into a tabular text array with the specified number of columns. Values are placed into the array according to their order in the list, with rows filled first.


The function can be used together with the TransposeArray() custom function to return an array ordered in 'columns down' order.

 

Comments

LaRetta   LaRetta, xxx,xx
May 11, 2010
This came in handy today when I was presented with a global text field containing 260 numbers as multiline and I needed to print the result to display which accts were selected (in the list).

Instead of one long column 260 lines long, I was about to break it into columns which saved three pages which would have only contained a single long string of numbers.
 

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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: