cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
A_Zaid
Level III

Selecting the x-axis conditionally

Hi everyone,

 

How do I make JSL plot a graph such that the x-axis is column 'A' if it exists in the data table, else, it uses column 'B' as the x-axis? I feel that it could be an adaptation of the solutions in this discussion:

If statement inside graph builder for SendToReport functionality 

 

This is the code I have so far (the plot is displayed in a dashboard, hence the use of 'Platform()'):

Report9 = Platform(dt,
			       gb9 = Graph Builder(
			                 Size( 534, 456 ),
				             Show Control Panel( 0 ),
				             Fit to Window( "Maintain Aspect Ratio" ),
				             Variables( X( :A ), Y( :Name("Population") ) ),
				             Elements(
						        Points( X, Y, Legend( 7 ) ),
						        Smoother( X, Y, Legend( 8 ) )
						)
					)
				);

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Selecting the x-axis conditionally

Check if column A exist in datatable (you can get all column names with << Get Column Names("String") and then use Contains() to check the list has a specific value), then based on if it does / doesn't, create variable which has the column you want and finally add it to Platform with Eval(EvalExpr())

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Selecting the x-axis conditionally

Check if column A exist in datatable (you can get all column names with << Get Column Names("String") and then use Contains() to check the list has a specific value), then based on if it does / doesn't, create variable which has the column you want and finally add it to Platform with Eval(EvalExpr())

-Jarmo

Recommended Articles