Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script for multi-dimensional array?

Featured Replies

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.

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.

  • 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.

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 )

)

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 )

)

  • Author

I'll give this a shot. Thank you so much for the tips.

  • Author

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...

@BruceR I just referenced this post for a project I'm working on. Great stuff, and thanks!

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.