cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
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