You need to make the pivot table the current data table. The variability chart platform is trying to run from the hurricanes table instead. This code works:
dt = Open( "$SAMPLE_DATA/Hurricanes.jmp" );
tdt = dt << Tabulate(
Add Table(
Column Table( Analysis Columns( :Atmospheric Pressure ), Statistics( N, Mean ) ),
Row Table( Grouping Columns( :Name, :Name( "Wind (Knots)" ) ) )
)
);
pivotTable = tdt << Make Into Data Table;
tdt << close window;
tbName = dt << get name() || " - Pivot Table";
pivotTable << set name( tbName );
current data table(pivottable);
Variability Chart(
Y( :Name( "Mean(Atmospheric Pressure)" ) ),
X( :Name( "Wind (Knots)" ), :Name ),
Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),
Process Variation( 0 ),
Connect Cell Means( 1 ),
Std Dev Chart( 0 ),
SendToReport(
Dispatch(
{"Variability Chart for Mean(Atmospheric Pressure)"},
"Variability Chart",
FrameBox,
{Grid Line Order( 5 ), Reference Line Order( 6 )}
)
)
);