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
Jackie_
Level VI

Similar keys

Hi,

 

 

 

Value column.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Similar keys

I would do this by utilizing SQL. This example should give an idea what you can do, you will have to do some cleanup on the values though

Names Default To Here(1);
dt_main = Open("$DOWNLOADS/maintable(1).jmp");
dt_ref = Open("$DOWNLOADS/referencetable(1).jmp");

dt_concat = Query(
	Table(dt_main, "t1"),
	"\[SELECT type, "X Coord", "Y Coord", "Wafer ID", GROUP_CONCAT(Value, ', ') as Value
	FROM t1
    group by type, "X Coord", "Y Coord", "Wafer ID"
    ]\"
);

dt_split = dt_concat << Split(
	Split By(:Type),
	Split(:Value),
	Group(:X Coord, :Y Coord, :Wafer ID)
);

dt_ref << Update(
	With(dt_split),
	Match Columns(:X Coord = :X Coord, :Y Coord = :Y Coord, :Wafer ID = :Wafer ID),
	Add Columns from Update Table(:A, :B),
	Replace Columns in Main Table(None)
);

jthi_0-1720028422685.png

Add Listagg/Concatenate/GROUP_CONCAT to Summary platform for a wishlist which should make this very easy

 

Edit:

Casting seems to be fairly simple way to get rid of the decimals

View more...
Names Default To Here(1);
dt_main = Open("$DOWNLOADS/maintable(1).jmp");
dt_ref = Open("$DOWNLOADS/referencetable(1).jmp");

dt_concat = Query(
	Table(dt_main, "t1"),
	"\[SELECT type, "X Coord", "Y Coord", "Wafer ID", GROUP_CONCAT(CAST(Value as int), ', ') as Value
	FROM t1
    group by type, "X Coord", "Y Coord", "Wafer ID"
    ]\"
);

dt_split = dt_concat << Split(
	Split By(:Type),
	Split(:Value),
	Group(:X Coord, :Y Coord, :Wafer ID)
);
Close(dt_concat, no save);

dt_ref << Update(
	With(dt_split),
	Match Columns(:X Coord = :X Coord, :Y Coord = :Y Coord, :Wafer ID = :Wafer ID),
	Add Columns from Update Table(:A, :B),
	Replace Columns in Main Table(None)
);
Close(dt_split, no save);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Similar keys

I would do this by utilizing SQL. This example should give an idea what you can do, you will have to do some cleanup on the values though

Names Default To Here(1);
dt_main = Open("$DOWNLOADS/maintable(1).jmp");
dt_ref = Open("$DOWNLOADS/referencetable(1).jmp");

dt_concat = Query(
	Table(dt_main, "t1"),
	"\[SELECT type, "X Coord", "Y Coord", "Wafer ID", GROUP_CONCAT(Value, ', ') as Value
	FROM t1
    group by type, "X Coord", "Y Coord", "Wafer ID"
    ]\"
);

dt_split = dt_concat << Split(
	Split By(:Type),
	Split(:Value),
	Group(:X Coord, :Y Coord, :Wafer ID)
);

dt_ref << Update(
	With(dt_split),
	Match Columns(:X Coord = :X Coord, :Y Coord = :Y Coord, :Wafer ID = :Wafer ID),
	Add Columns from Update Table(:A, :B),
	Replace Columns in Main Table(None)
);

jthi_0-1720028422685.png

Add Listagg/Concatenate/GROUP_CONCAT to Summary platform for a wishlist which should make this very easy

 

Edit:

Casting seems to be fairly simple way to get rid of the decimals

View more...
Names Default To Here(1);
dt_main = Open("$DOWNLOADS/maintable(1).jmp");
dt_ref = Open("$DOWNLOADS/referencetable(1).jmp");

dt_concat = Query(
	Table(dt_main, "t1"),
	"\[SELECT type, "X Coord", "Y Coord", "Wafer ID", GROUP_CONCAT(CAST(Value as int), ', ') as Value
	FROM t1
    group by type, "X Coord", "Y Coord", "Wafer ID"
    ]\"
);

dt_split = dt_concat << Split(
	Split By(:Type),
	Split(:Value),
	Group(:X Coord, :Y Coord, :Wafer ID)
);
Close(dt_concat, no save);

dt_ref << Update(
	With(dt_split),
	Match Columns(:X Coord = :X Coord, :Y Coord = :Y Coord, :Wafer ID = :Wafer ID),
	Add Columns from Update Table(:A, :B),
	Replace Columns in Main Table(None)
);
Close(dt_split, no save);
-Jarmo
Jackie_
Level VI

Re: Concat row values

Thanks a lot Jarmo!