Hey everyone,
I'm new to JMP scripts and I'm hoping this may help others too. From the sample data screenshot below (stored as a .JMP file), I'd like to select Material and Month and round Stock to a whole number. I'd then like to filter only records where the rounded Stock calculation is greater than zero. Finally I'd like the results to be saved as a CSV file.
Here is my initial attempt at a JSL version. I'm pretty sure I'm not using the dt expressions correctly (likely among several other things as well) Any help would be tremendously appreciated.
dt = Open( "$SAMPLE_DATA\My JMP Table.jmp" );
columns(
:Material,
:Month,
New Column("Stock Integer", Numeric, "Continuous", Formula(Round( :Stock,0))
)
dt << Select Where Formula(Round( :Stock,0)) >=0
dt << save( "$Desktop\test.csv" );
Here is an SQL-like equivalent of what I'm trying to do
SELECT
[My JMP Table].Material,
[My JMP Table].Month,
Round([My JMP Table].Stock,0) AS Stock_Integer
INTO
test.csv
FROM
[My JMP Table]
WHERE
Round([My JMP Table].[Stock],0)>0
;
Thanks so much!