BookmarkSubscribeRSS Feed
peterj

Community Trekker

Joined:

Jun 23, 2011

Using a variable value in script created formula

I am using a script to create a new column with a formula based on a date entered by a user in a dialog box. Using the code below the formula uses the variable "MyDate" instead of the value stored in it.

4 REPLIES
mpb

Super User

Joined:

Jun 23, 2011

Re: Using a variable value in script created formula

Try this:

peterj

Community Trekker

Joined:

Jun 23, 2011

Re: Using a variable value in script created formula

That gave me the same result, it didn't substitute the right value in for the variable name.

Thanks for the suggestion though.
mpb

Super User

Joined:

Jun 23, 2011

Re: Using a variable value in script created formula

It works perfectly for me. What version of JMP and what platform (Windows?, Mac?, Linux?). When I enter 05May2009:4:00 PM in a Dialog Text Box this is the formula that gets generated: If(:DateTime lt 05May2009:16:00:00, "Yes", "No") with a less than symbol in place of the "lt". Here's the code I executed. I first tried it without a dialog and used the commented out line instead. They both work. Assumes a table is open with a DateTime column containing DateTimes.

peterj

Community Trekker

Joined:

Jun 23, 2011

Re: Using a variable value in script created formula

You are correct, that did work. I missed an Expr() when I transcribed it back into my script.

Thanks so much for the help.