BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
peterj
Community Trekker

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.

0 Kudos
4 REPLIES 4
mpb
Super User mpb
Super User

Re: Using a variable value in script created formula

Try this:

0 Kudos
peterj
Community Trekker

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.
0 Kudos
mpb
Super User mpb
Super User

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.

0 Kudos
peterj
Community Trekker

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.
0 Kudos