Choose Language Hide Translation Bar
Highlighted
LarsBirger
Level II

How to choose the appropriate value from a column.

I am using JMP 14.2 on a Mac and I love the program. Presently I am doing an analysis in a research project where I would like to write a formula in a column that could pick the appropriate value from one of three possible columns. The case is as follows:

 

I have three columns that describe the time from different events:

Time 1 is the time in days from the event to a final date

Time 2 is the time in days from the event to mors

Time 3 is the time in days from event 1 to event 2

If there is a number in the Time 3 column I would like to get that in the fourth column 

If there is a number in the Time 2 column but not in Time 3 I would like to get that number and so on

 

An example:

Time 1 .     Time 2 .     Time 3 .       Final column

130           120             ------            120

200           -----             ------            200

310          134              51                 51

etc.

 

Is it possible to write a formula in the the final column that could solve this?

 

Sincerely yours

 

Lars Enochsson

 

 

Lars Enochsson

MD, PhD

Professor of Surgery

Department of Surgical and Perioperative Sciences, Surgery

Umeå University

SE-901 87 Umeå, Sweden

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: How to choose the appropriate value from a column.

Here is one way to do the formula:

If(
	Is Missing( :Time 3 ) == 0, x = :Time 3,
	Is Missing( :Time 2 ) == 0, x = :Time 2,
	Is Missing( :Time 1 ) == 0, x = :Time 1,
	x = .
);
x;
Jim

View solution in original post

1 REPLY 1
Highlighted
txnelson
Super User

Re: How to choose the appropriate value from a column.

Here is one way to do the formula:

If(
	Is Missing( :Time 3 ) == 0, x = :Time 3,
	Is Missing( :Time 2 ) == 0, x = :Time 2,
	Is Missing( :Time 1 ) == 0, x = :Time 1,
	x = .
);
x;
Jim

View solution in original post

Article Labels

    There are no labels assigned to this post.