cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

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

Fill column once per group without repeating values with JSL

Hi!

So I have the below data table.  The individual test results are in the "test result" column and indicate if the respective y passes test a,b, and c. The "overall result" column indicates a "pass" if 2 or more of the tests (a,b,c) pass.

 

I was able compute the overall result with a formula, but what I would like to do is get a list that says the result once per Y variable-- i.e. overall result = "pass, fail, pass" like the ideal overall result has. Any ideas??

Abby_Collins14_0-1711058765076.png

code for dt: 

dt = New Table( "example",
	Add Rows( 0 ),
	New Column( "Y", character ),
	New Column( "test",character ),
	New Column( "test result",character )
	
)

:Y << set values( {var1,var1,var1,var2,var2,var2,var3,var3,var3});

:test << set values( {a,b,c,a,b,c,a,b,c});

:test result<< set values( {pass,pass,fail,fail,pass,fail,pass,pass,pass});

new column("overall result",Formula(if(col sum(test result=="pass",Y)>=2, "Pass", "Fail")));
1 ACCEPTED SOLUTION

Accepted Solutions
mmarchandTSI
Level V

Re: Fill column once per group without repeating values with JSL

Just need a small change to your formula.

 

New Column( "overall result",
	Formula(
		If(
			Col Cumulative Sum( 1, :Y ) > 1, "",
			Col Sum( test result == "pass", :Y ) >= 2, "Pass",
			"Fail"
		)
	)
);

mmarchandTSI_0-1711060120886.png

 

View solution in original post

2 REPLIES 2
mmarchandTSI
Level V

Re: Fill column once per group without repeating values with JSL

Just need a small change to your formula.

 

New Column( "overall result",
	Formula(
		If(
			Col Cumulative Sum( 1, :Y ) > 1, "",
			Col Sum( test result == "pass", :Y ) >= 2, "Pass",
			"Fail"
		)
	)
);

mmarchandTSI_0-1711060120886.png

 

jthi
Super User

Re: Fill column once per group without repeating values with JSL

Additional option (I usually do these type of "shifts" using Row() == Col Min(Row()) or Row() == Col Max(Row())).

Names Default To Here(1);

dt = New Table("example 4",
	Add Rows(9),
	Compress File When Saved(1),
	New Column("Y", Character, "Nominal", Set Values({"var1", "var1", "var1", "var2", "var2", "var2", "var3", "var3", "var3"})),
	New Column("test", Character, "Nominal", Set Values({"a", "b", "c", "a", "b", "c", "a", "b", "c"})),
	New Column("test result", Character, "Nominal", Set Values({"pass", "pass", "fail", "fail", "pass", "fail", "pass", "pass", "pass"}))
);

dt << New Column("Res",	Character, Nominal, Formula(
	If(Row() != Col Min(Row(), :Y),
		"" // not first row fir Y group
	, Col Sum(:test result == "pass", :Y) >= 2,
		"pass"
	, // else
		"fail"
	)
));
-Jarmo

Recommended Articles