including formula in a column using JSL<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />i want to add a column that performs the following calculation:
if(Is Missing(Column1)=> 2
else=> column2)
how do i include in the column code using JSL.
i wrote a code like this:
dt<
continuous,
Format("m/d/y",12),
Formula(if(Is Missing(:Column1)), 2
else :Column2
));
but it is not working..can some one help..
Re: including formula in a column using JSLCheck out the correct syntax for the If() function, e.g. by using the excellent Scripting Index (Help menu) Why does your code not work? A comma is missing, else is not needed or even defined, and paranthesis appears to be misplaced. Check also that the the column names are Column1 and Column2 and not Column 1 and Column 2 (Default in a new table is with a space. JMP is picky about white-space in strings).
This may have a better chance to work:
dt<<new column("New Date",
continuous,
Format("m/d/y",12),
Formula(if(Is Missing(:Column 1), 2,
:Column 2
)));