cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

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