about JSL formula to mark lowest 6 numbers within each fixed ItemI have one table with column "ITEM" and "ID", and the "ID" column value is random, could help to suggest how to use JSL formula to create one new column, and fill in content "Y" when the "ID" value is the lowest 6 within each fixed "ITEM" value. thanks a lot
| ITEM | ID | 6 low ID within each Fixed Item? |
| OHO1129 | 73 | Y |
| OHO1129 | 111 | |
| OHO1129 | 72 | Y |
| OHO1129 | 71 | Y |
| OHO1129 | 114 | |
| OHO1129 | 113 | |
| OHO1129 | 69 | Y |
| OHO1129 | 109 | |
| OHO1129 | 70 | Y |
| OHO1129 | 116 | |
| OHO1129 | 115 | |
| OHO1129 | 110 | |
| OHO1129 | 74 | |
| OHO1129 | 68 | Y |
| OHO1129 | 112 | |
| OHO1181 | 126 | |
| OHO1181 | 129 | |
| OHO1181 | 130 | |
| OHO1181 | 128 | |
| OHO1181 | 127 | |
| OHO1181 | 126 | |
| OHO1181 | 93 | Y |
| OHO1181 | 129 | |
| OHO1181 | 92 | Y |
| OHO1181 | 96 | Y |
| OHO1181 | 91 | Y |
| OHO1181 | 100 | |
| OHO1181 | 99 | |
| OHO1181 | 97 | |
| OHO1181 | 94 | Y |
| OHO1181 | 128 | |
| OHO1181 | 127 | |
| OHO1181 | 98 | |
| OHO1181 | 95 | Y |
| OHO1191 | 79 | |
| OHO1191 | 77 | |
| OHO1191 | 78 | |
| OHO1191 | 82 | |
| OHO1191 | 83 | |
| OHO1191 | 84 | |
| OHO1191 | 81 | |
| OHO1191 | 76 | |
| OHO1191 | 80 | |
| OHO1191 | 37 | |
| OHO1191 | 36 | |
| OHO1191 | 35 | |
| OHO1191 | 34 | Y |
| OHO1191 | 33 | Y |
| OHO1191 | 31 | Y |
| OHO1191 | 30 | Y |
| OHO1191 | 29 | Y |
| OHO1191 | 32 | Y |
| OHO1191 | 76 | |
| OHO1191 | 75 | |
| OHO1192 | 161 | |
| OHO1192 | 157 | |
| OHO1192 | 71 | Y |
| OHO1192 | 153 | |
| OHO1192 | 68 | Y |
| OHO1192 | 156 | |
| OHO1192 | 155 | |
| OHO1192 | 73 | |
| OHO1192 | 67 | Y |
| OHO1192 | 160 | |
| OHO1192 | 72 | Y |
| OHO1192 | 158 | |
| OHO1192 | 69 | Y |
| OHO1192 | 74 | |
| OHO1192 | 159 | |
| OHO1192 | 151 | |
| OHO1192 | 70 | Y |
ScriptingRe: about JSL formula to mark lowest 6 numbers within each fixed ItemHere is one way to solve your issue.

Here is the formula I used
If( Row() == 1 | Lag( :ITEM ) != :ITEM,
currentItem = :ITEM;
theRows = Current Data Table() << get rows where( :ITEM == currentItem );
For( i = 1, i <= N Rows( theRows ), i++,
theRows[i] = :ID[theRows[i]]
);
r = Rank( theRows );
theValues = theRows[r];
Remove From( theValues, 7, 9999999 );
);
If( N Rows( Loc( theValues, :ID ) ) > 0,
"Y",
""
);
I have attached the sample data table shown above
Re: about JSL formula to mark lowest 6 numbers within each fixed ItemYou can also use Col Rank combined with if:
tempRank = Col Rank(:ID, :ITEM);
If(tempRank <= 6, "Y", "");
Re: about JSL formula to mark lowest 6 numbers within each fixed ItemBetter answer