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
G_M
G_M
Level III

Support needed: How to fill variable number of cells in a data table

Hello JMP Community,

Attached is a sample data table and the target table that I am aiming for.

The data table is organized with a parent row and a variable number of child rows under the parent row.  The parent row also has a column which indicates the Status of the account (see last column of Sample.jmp).  I would like to copy the status of the parent row to the child rows (see last column of TargetFile.jmp).  I believe that Lag() is the correct function, I just can't figure out how to deal with variable number of child rows?

 

Many thanks in advance!

Sincerely,

MG

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Support needed: How to fill variable number of cells in a data table

You can certainly do this with Lag() but you might also be able to do this interactively in JMP (not sure which version gives this option, I'm using JMP16.1... there are also addins to do this).

Select the column you want to fill

jthi_0-1638295403825.png

Right click on top of the values and select Fill / Replace Missing with Previous value

jthi_1-1638295422387.png

jthi_2-1638295501234.png

 

Edit:

With Lag one way to do this is to create new column and use formula like:

If(Row() == 1, val = :Status);
If(:Status == "",
	val,
	val = :Status
);

jthi_3-1638295726778.png

 

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Support needed: How to fill variable number of cells in a data table

You can certainly do this with Lag() but you might also be able to do this interactively in JMP (not sure which version gives this option, I'm using JMP16.1... there are also addins to do this).

Select the column you want to fill

jthi_0-1638295403825.png

Right click on top of the values and select Fill / Replace Missing with Previous value

jthi_1-1638295422387.png

jthi_2-1638295501234.png

 

Edit:

With Lag one way to do this is to create new column and use formula like:

If(Row() == 1, val = :Status);
If(:Status == "",
	val,
	val = :Status
);

jthi_3-1638295726778.png

 

 

-Jarmo
G_M
G_M
Level III

Re: Support needed: How to fill variable number of cells in a data table

Thanks @jthi