cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
PowerOx327
Level II

How do I insert Multiple Values to Associative Array

Hi,

 

I'm trying to create an array that sets multiple values to one object:

Is there any way to do this? What I'm trying to do is set if users choose "B", then Both "X" and "." get chosen. Can anyone help?

Array = Associative Array( {"A", "B"}, { "X", "X AND ."});

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How do I insert Multiple Values to Associative Array

You could use a list (or another associative array) as the value

Names Default To Here(1);

aa = Associative Array({"A", "B"}, {"A", {"X", "."}});
show(aa);
aa = .;

aa = Associative Array();
aa["A"] = "X";
aa["B"] = {"X", "."};
show(aa);
aa = .;

aa = [
	"A" => "X",
	"B" => {"X", "."}
];
show(aa);
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: How do I insert Multiple Values to Associative Array

You could use a list (or another associative array) as the value

Names Default To Here(1);

aa = Associative Array({"A", "B"}, {"A", {"X", "."}});
show(aa);
aa = .;

aa = Associative Array();
aa["A"] = "X";
aa["B"] = {"X", "."};
show(aa);
aa = .;

aa = [
	"A" => "X",
	"B" => {"X", "."}
];
show(aa);
-Jarmo

Recommended Articles