cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar

how to Resolution Problem with Formula for Column

Code: 

If(

!Contains(col_name_list, "EFT (h)"),

Current Data Table() << New Column(

"EFT (h)",

Numeric,

Continuous,

Format("Fixed Dec", 10, 1),

Formula(

:Name( "duration" ) * 24

)

)

);



Error:

Unexpected ")". Perhaps there is a missing ";" or ",".

Line 9 Column 6:    ))►)

 

The remaining text that was ignored was

)

Resolution Problem with Formula for Column EFT (h):

 

I am unable to figure out, what this could be. 

 

I have tried this too: 

If(
	!Contains(col_name_list, "EFT (h)"),
	Current Data Table() << New Column(
		"EFT (h)",
		Numeric,
		Continuous,
		Format("Fixed Dec", 10, 1),
		Formula(:duration * 24)
	)
);
3 REPLIES 3

Re: how to Resolution Problem with Formula for Column

If(
	!Contains(col_name_list, "EFT (h)"),
	Current Data Table() << New Column(
		"EFT (h)",
		Numeric,
		Continuous,
		Format("Fixed Dec", 10, 1),
		Formula( 
		:Name( "EFT (h)" ) * 24 
		)
	)
);

using this

hogi
Level XII

Re: how to Resolution Problem with Formula for Column

Please note that in the last version the column duration is replaced with column EFT(h).
To find issues with commas, you can double click on a bracket and the corresponding bracket will be marked as well - together with the enclosed script.

Another option: use reformat script.
It works like executing the code: the syntax is checked and in case of an error the line of with the error will be indicated in the log.

hogi_0-1757672127191.png

 

Applying such checks, there are no issues with commas in your code.

Besides manual checks, some automation will help. e.g. automatic coloring of the code, like suggested in this wish:
Advanced syntax highlighting in JSL Editor - does the function evaluate its argument? 

hogi
Level XII

Re: how to Resolution Problem with Formula for Column

The most complicate issue with unbalanced brackets:

for ( i=1, i < 10, i++, 
	list = { A, B, C ;
	E+F;
);

hogi_0-1757674207545.png

 

... the issues with "balanced" brackets.
When you position the cursor behind the closing bracket, it shows the corresponding opening bracket:

hogi_1-1757674420131.png

So, everything OK? Why the error message abut the closing ")"?

 

JMP has a hint:

hogi_2-1757674445786.png

So, let's check the curly brackets ...

 

 

Interesting, in your case the suggestion was:

hogi_3-1757674546211.png
?

Recommended Articles