Hello
I have a table and would like the empty volume to be updated to 0
I have written the script to update the column "19-04-2024"
the problem is the name of the column can be changed and I prefer to use column (3) or column (4)
but it doesn't work.
can you please correct the script?
dt << Begin Data Update;
dt << Recode Column (
dt << Column (3),
{Map Value( _rcOrig, {., 0}, Unmatched( _rcNow ) )},
Update Properties( 1 ),
Target Column(Column (3) ) );
dt << End Data Update;
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Recode Column(
/*Print(.);*/AsColumn(dt, Print(1);2),
Print(2);{Print(3);Map Value(_rcOrig, {12, Print(4);0}, Unmatched(_rcNow))},
/*Print(0);*/Update Properties(Print(5);1),
/*Print(0);*/Target Column(/*Print(.);*/AsColumn(dt, Print(6);4))
);gives
2 5 6 1 1 3 3 3 3 3 3 1 :height
(A) In
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt[1,"age"]=4;
row()=1;
AsColumn(dt, tmp=As Column(2);print(tmp);tmp /*=4*/); // column #4 , row #1= 59
Sum(As Column(2) ,7) // 4 + 7 = 11
The result of As Column(2)is not column #2, it's the value of column #2 (in row #1).
(B) On the other hand, the first argument of Recode Column( ) gets only evaluated to a level where As Column() returns the column reference
... and NOT the value of the current row (like in the first example).
Same for the argument of the Target Column() argument.
@joseph_morgan talks in
= (A)
if this "standard" is prevented (B), it feels like magic :)
So, concerning Advanced syntax highlighting in JSL Editor - does the function evaluate it's argument? , maybe we need a third color?