I'm having a problem where the formulas are returning null values.
The raw table is the raw data and there is a specification table, which is used to determine whether the raw data passes or fails according to the specification table. I have written a JSL, please help me to see what the problem is, thanks.
Names Default To Here( 1 );
//raw data
dt = Data Table( "raw data001" );
dt1 = dt << subset( all rows, all columns );
//spec table
dtbz = Data Table( "Spec" );
LSL = dtbz[0, 3];
USL = dtbz[0, 4];
dtbz << New Column( "combine", formula( :Project || :Item ) );
// Create separate judgment columns for the columns to be judged
items = Design( dtbz:Item << get values(), <<levels )[2];
// new column to justify the pass/no pass
For( i = 1, i <= N Items( items ), i++,
it = items[i];
dt1 << New Column( it || "—pass/no pass",
formula(
If(
:Project == "A" & N Items( Loc( dtbz:combine << get as matrix(), "A" || it ) ) > 0,
dtbz:LSL[Loc( dtbz:combine << get as matrix(), "A" || it )[1]] <= Column( dt1, items[i] ) <= dtbz:USL[
Loc( dtbz:combine << get as matrix(), "A" || it )[1]],
:Project == "B" & N Items( Loc( dtbz:combine << get as matrix(), "B" || it ) ) > 0,
dtbz:LSL[Loc( dtbz:combine << get as matrix(), "B" || it )[1]] <= Column( dt1, items[i] ) <= dtbz:USL[
Loc( dtbz:combine << get as matrix(), "B" || it )[1]],
:Project == "C" & N Items( Loc( dtbz:combine << get as matrix(), "C" || it ) ) > 0,
dtbz:LSL[Loc( dtbz:combine << get as matrix(), "C" || it )[1]] <= Column( dt1, items[i] ) <= dtbz:USL[
Loc( dtbz:combine << get as matrix(), "C" || it )[1]],
:Project == "D" & N Items( Loc( dtbz:combine << get as matrix(), "D" || it ) ) > 0,
dtbz:LSL[Loc( dtbz:combine << get as matrix(), "D" || it )[1]] <= Column( dt1, items[i] ) <= dtbz:USL[
Loc( dtbz:combine << get as matrix(), "D" || it )[1]],
)
)
)
);