- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Begin Data Update
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Begin 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
- Print(0): no command expected here → error message → /* I put them into comments */
- Print 2: 2nd argument gets evaluated; the list stays as it is (list don't get evaluated)
- Print(5) & Print (6) → arguments of the named arguments get evaluated
- Print(1): now the first argument gets evaluated - why two times?
- Print(3): 6 times (!) ( independent of values to replace )
- Print(1): again ?
- [Print(.): are evaluated, but prevent Jmp from correctly getting the Column infos → /* I put them into comments */]
- Print(4): doesn't show up → not expected here → error → values are replaced by "." (instead of 0)
- :height : return value: target column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Begin Data Update
(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= 59Sum(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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Begin Data Update
So, concerning Advanced syntax highlighting in JSL Editor - does the function evaluate it's argument? , maybe we need a third color?
- « Previous
-
- 1
- 2
- Next »