cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
hyue
Level I

Converting Between Data Tables and Associative Arrays

Hi there,

 

Is there a simple way to convert a data table to an associative array?  I'm trying to pass the associative array to an external API for analysis, and then getting the results back into JMP as a data table afterwards.

 

Thanks!

 

Howard

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Converting Between Data Tables and Associative Arrays

Check the scripting index (Help > Scripting Index).  The AA will accept a matrix or a list as an input when you create it.  So, the easiest way would be to get your Key column as a list, your value column as a list, and pass those to the AA command as the Keys and Values.  

 

If you want to get multiple columns into your Value for a given Key you can do that too.  There are some great examples in the scripting guide (Help > Books > JMP Scripting Guide).  You can also look at the code I use here: Total Recall: A new strategy for Recall support in JMP applications for some examples on how I work with AA's.

 

M

 

 

View solution in original post

2 REPLIES 2

Re: Converting Between Data Tables and Associative Arrays

Check the scripting index (Help > Scripting Index).  The AA will accept a matrix or a list as an input when you create it.  So, the easiest way would be to get your Key column as a list, your value column as a list, and pass those to the AA command as the Keys and Values.  

 

If you want to get multiple columns into your Value for a given Key you can do that too.  There are some great examples in the scripting guide (Help > Books > JMP Scripting Guide).  You can also look at the code I use here: Total Recall: A new strategy for Recall support in JMP applications for some examples on how I work with AA's.

 

M

 

 

hyue
Level I

Re: Converting Between Data Tables and Associative Arrays

Thanks, M.  That was a good idea and I have implemented it.

 

Howard