Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3412 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

Posted

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 )

)

Posted

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 )

)

Posted

BruceR -

It worked. Now I can get back to coding the rest of the solution. Thank you so much for your help!

  • 5 years later...
Posted

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

)

This topic is 3412 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.