Function overview
Prototype
array.cellValueByColNum (
array; rowName; column; delimiter )
Parameters
array
rowName
column
delimiter
Description
Tags:
Text Parsing cell Array
A function to return the cell value from an array by specifying the row name and column number. Row names must be unique or only the first occurrance will be returned.
Have included the option to specify the delimiter for maximum flexibility. The first column with the row names is treated as row 0 (zero) for this cf. See also array.cellValueByColTitle
Examples
Sample input
array.cellValueByColNum ( array ; "jelly" ; 1 ; "§" )
where array is
row1§40§200
row2§200§40
jelly§very wobbly§raspberry
Sample output
very wobbly
Function code
/*
Name:
array.cellValueByColNum
History:
Created by Tim Anderson, Tim Anderson Group
www.timanderson.co.uk
Creation Date: 5 January 2009
Modified: 6 Jan 2009 - Now treats row names as column 0 (zero) and changed name. See also array.cellValueByColTitle
15 Jan 2009 - Now does not return first row if ror name not in list
Purpose:
A function to return the column value from an array by specifying the row name. Row names must be unique or only the first occurrance will be returned.
Parameters:
array
rowName
column
delimiter
Example:
array.cellValueByColNum ( array ; "jelly" ; 1 ; "§" ) gives "very wobbly" (no quotes) where array is
row1§40§200
row2§200§40
jelly§very wobbly§raspberry
Requires Other Custom Functions:
None
Other Notes:
Have included the option to specify the delimiter for maximum flexibility. See also array.cellValueByColTitle
Options:
None
*/
Let([_rname="¶" & rowName & "§";
_notHere=PatternCount(array;_rname)=0;
_string=Right("¶" & array;Length(array)-Position("¶" & array;_rname;1;1));
_row=GetValue(_string;1)];
Choose(_notHere;GetValue(Substitute(_row;delimiter;"¶");column+1);"")
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/173
Prototype: array.cellValueByColNum( array; rowName; column; delimiter )
Function Author: TimA (http://www.fmfunctions.com/mid/102)
Last updated: 16 January 2009
Version: 2.0
*/
// ===================================
/*__LITBR____LITBR__Name:__LITBR__array.cellValueByColNum__LITBR____LITBR__History:__LITBR__Created by Tim Anderson, Tim Anderson Group__LITBR__www.timanderson.co.uk__LITBR__Creation Date: 5 January 2009__LITBR__Modified: 6 Jan 2009 - Now treats row names as column 0 (zero) and changed name. See also array.cellValueByColTitle__LITBR__ 15 Jan 2009 - Now does not return first row if ror name not in list__LITBR____LITBR__ __LITBR__Purpose: __LITBR__A function to return the column value from an array by specifying the row name. Row names must be unique or only the first occurrance will be returned.__LITBR____LITBR__Parameters: __LITBR__array__LITBR__rowName__LITBR__column__LITBR__delimiter__LITBR__ __LITBR__Example: __LITBR__array.cellValueByColNum ( array ; "jelly" ; 1 ; "§" ) gives "very wobbly" (no quotes) where array is__LITBR__row1§40§200__LITBR__row2§200§40__LITBR__jelly§very wobbly§raspberry__LITBR__ __LITBR____LITBR__Requires Other Custom Functions:__LITBR__None__LITBR____LITBR__Other Notes:__LITBR__Have included the option to specify the delimiter for maximum flexibility. See also array.cellValueByColTitle__LITBR____LITBR__Options:__LITBR__None__LITBR____LITBR__*/ __LITBR__Let([_rname="¶" & rowName & "§";__LITBR__ _notHere=PatternCount(array;_rname)=0;__LITBR__ _string=Right("¶" & array;Length(array)-Position("¶" & array;_rname;1;1));__LITBR__ _row=GetValue(_string;1)];__LITBR__Choose(_notHere;GetValue(Substitute(_row;delimiter;"¶");column+1);"")__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/173__LITBR____LITBR__ Prototype: array.cellValueByColNum( array; rowName; column; delimiter )__LITBR__ Function Author: TimA (http://www.fmfunctions.com/mid/102)__LITBR__ Last updated: 16 January 2009__LITBR__ Version: 2.0__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.