May 15, 201015 yr I’ve created a variable $inv_check I'd like to use as a multi-dimensional array. While I seem to have created it ok, I’m stuck on extracting values from the array. $inv_check = inv_id & start_date & rate for a list of records. Each set of values is separated by a carriage return. For example: $inv_check= 100 1/1/10 1/5/10 101 1/5/10 1/25/10 106 2/1/10 3/1/10 Now I'd like to be able to run queries on a table using the data from $inv_check. I typically use the GetValue function for simple lists, but can’t seem to get the values past the 1st parameter. How do you extract values past the first parameter? Thanks in advance for the help.
May 15, 201015 yr Each set of values is separated by a carriage return. And the values in a set are separated by … ? BTW, your example shows two dates, not a date and a rate.
May 15, 201015 yr Author The 3 values are separated from each other by a tab Each row is separated by a carriage return Sorry for the error in the example. In fact, parameters 2 and 3 are dates. There is no rate.
May 15, 201015 yr char(9) is the tab character Let([ R = 2 ; //row we want C = 3 ; //column we want thisRow = getValue( $inv_check; R); splitRow = substitute( thisRow; char(9); ¶)]; Getvalue( splitRow; C ) )
May 15, 201015 yr Or: optional input format - try removing either input Let([ input = "R2C3"; input = 2.1; RC = substitute( input; ["R"; ""];["C"; ¶]; ["."; ¶] ); R = getValue( RC; 1); C = getValue( RC; 2); thisRow = getValue( $inv_check; R); splitRow = substitute( thisRow; char(9); ¶)]; Getvalue( splitRow; C ) )
May 21, 201015 yr Author BruceR - It worked. Now I can get back to coding the rest of the solution. Thank you so much for your help!
July 21, 201510 yr @BruceR I just referenced this post for a project I'm working on. Great stuff, and thanks!
July 21, 201510 yr Haha - I want to help skin the cat ;oP Let([ a = "100 1/1/10 1/5/10¶101 1/5/10 1/25/10¶106 2/1/10 3/1/10"; b = "r3 c1"; c = GetValue(Substitute(GetValue ( a ; Filter ( "0123456789" ; LeftWords(b, 1) )), Char(9), "¶"), Filter ( "0123456789" ; RightWords(b, 1) )) ]; c )
Create an account or sign in to comment