cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

formula

hcarr01
Level VI
Hello everyone,
I have a simple question for you, I would like to build the following query using formulas in JMP if possible:
 
Put in the "error" column the value 1 one line after a cell in the "balance" column is non-zero.
 
Here is the database:
 
undefined
Line 38,061 should have the value in the "balance sheet" column be 1 and line 38,060 not.
 
Thank you for your answers !

This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .

2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User


Re: formule

Using Lag() (and possibly check for first row) should be enough here.

Names Default To Here(1);

dt = New Table("Untitled 5",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("Column 1", Character, "Nominal", Set Values({"", "aaa", ""}))
);

dt << New Column("Col", Numeric, Nominal, Formula(
	Row() != 1 & !IsMissing(Lag(:Column 1, 1))
));
-Jarmo

View solution in original post

txnelson
Super User


Re: formule

Jarmo's formula works fine, but it can be simplified to

If( Is Missing( Lag( :Bilan ) ) == 0,
	1,
	0
)

which will increase the runtime efficiency

Jim

View solution in original post

2 REPLIES 2
jthi
Super User


Re: formule

Using Lag() (and possibly check for first row) should be enough here.

Names Default To Here(1);

dt = New Table("Untitled 5",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("Column 1", Character, "Nominal", Set Values({"", "aaa", ""}))
);

dt << New Column("Col", Numeric, Nominal, Formula(
	Row() != 1 & !IsMissing(Lag(:Column 1, 1))
));
-Jarmo
txnelson
Super User


Re: formule

Jarmo's formula works fine, but it can be simplified to

If( Is Missing( Lag( :Bilan ) ) == 0,
	1,
	0
)

which will increase the runtime efficiency

Jim

Recommended Articles

No recommendations found