Subscribe Bookmark RSS Feed

What is causing my script to unhide all data tables?

markschwab

Community Trekker

Joined:

Apr 15, 2016

EDIT: I discovered the issue is not with/in JMP or JSL, it's an issue with the program I was using to interface with JMP. Sorry for the confusion.

I am working on a JSL script, but currently when I run the script, all hidden data tables become un-hidden. Does anyone know of what could be causing these tables to become unhidden?  Here is a simplified version of the code I'm using:

 

Names Default To Here(1);

 

data = Data Table (1);

 

New Column( "…",

 

     Numeric,

 

     Continuous,

 

     Format( "Best", 8 ),

 

     Formula( :- 20 )

 

);

 

StackedData = data << Stack(

 

     columns( :, :,

 

     Source Label Column("Measurement"),

 

     Stacked Label Column("Stacked Label"),

 

     Number of Series (2),

 

     Output Table ("Stacked Data")

 

);

 

Current Data Table(StackedData);

 

column("data") << Set Name ("ΔX");

 

column("data 2") << Set Name ("ΔY");

 

New Column( "Measurement",

 

     Nominal,

 

     Format( "Best", 8 ),

 

     Formula(Concat(If(Left(:Measurement Site,3)=="…","…",Left(:Measurement Site,3)=="…","…",Left(:Measurement Site,3)=="…","…","..")) )

 

);

 

gb = Graph Builder(

 

     Variables( X( :ΔX ), Y( :ΔY ), Wrap( :, Order By( :, Ascending, Order Statistic( "Mean" )  )), Overlay( :Measurement) ),

 

     Elements(

 

          Line( X, Y, Legend( 1 ), Row order( 1 ), Summary Statistic( "Mean" ) ),

 

          Points( X, Y, Legend( 2 ))

 

     )

 

);

 

 

Summarize(AllMeasurements = by(column(StackedData,"Measurement")));

 

 

For(i = 1, i <= N Items(AllMeasurements), i++,

 

    If(Contains(AllMeasurements[i], "…"),

 

        gb << SendToReport(

 

            Dispatch({}, "400", ScaleBox,

 

                {Legend Model(1, Properties(i - 1, {Line Style("dotted")}))}

            )

        )

    )

);

 

For(i = 1, i <= N Items(AllMeasurements), i++,

 

    If(Contains(AllMeasurements[i], ".."),

 

        gb << SendToReport(

 

            Dispatch({}, "400", ScaleBox,

 

                {Legend Model(1, Properties(i - 1, {Line Style("DashDotDot")}))}

            )

        )

    )

);

 

For( i = 1, i <= N Items( AllMeasurements ), i++,

 

     If( Contains( AllMeasurements[i], "…" ),

 

          gb << SendToReport(

 

              Dispatch(

 

                   {},

 

                   "400",

 

                   ScaleBox,

 

                   {Legend Model( 1, Properties( i - 1, {Line Color( 5 )} ) )}

              )

          )        

     )

);

 

For( i = 1, i <= N Items( AllMeasurements ), i++,

 

     If( Contains( AllMeasurements[i], "target" ),

 

          gb << SendToReport(

 

              Dispatch(

 

                   {},

 

                   "400",

 

                   ScaleBox,

 

                   {Legend Model( 1, Properties( i - 1, {Line Color( 0 )} ) )}

              )

          )

     )

);

 

StackedData << show window(0);

 

data << show window(0);

 

Message was edited by: Mark Schwab

2 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

You need to use the "invisible" or "Private" element in you script to declare a data table hidden.  Below is a modification of your script doing that.  Your data table referenced by the handle "Data" remains unhidden, because the code used to create it is not available, and that is where you would implement the "Invisible" or "Private" element:

Names Default To Here(1);

data = Data Table (1);

New Column( "…",

     Numeric,

Continuous,

     Format( "Best", 8 ),

     Formula( :… - 20 

);

StackedData = data << Stack(invisible,

     columns( :…, :…,

     Source Label Column("Measurement"),

     Stacked Label Column("Stacked Label"),

     Number of Series (2),

     Output Table ("Stacked Data")

);

//Current Data Table(StackedData);

StackedData:data << Set Name ("ΔX");

StackedData:data 2 << Set Name ("ΔY");

StackedData << New Column( "Measurement",

     Nominal,

     Format( "Best", 8 ),

     Formula(Concat(If(Left(:Measurement Site,3)=="…","…",Left(:Measurement Site,3)=="…","…",Left(:Measurement Site,3)=="…","…","..")) )

gb = StackedData << Graph Builder(

Variables( X( :ΔX ), Y( :ΔY ), Wrap( :… , Order By( :…, Ascending, Order Statistic( "Mean" )  )), Overlay( :Measurement) ),

Elements(

          Line( X, Y, Legend( 1 ), Row order( 1 ), Summary Statistic( "Mean" ) ),

Points( X, Y, Legend( 2 )

     )

);

Summarize(StackedData, AllMeasurements = by(column(StackedData,"Measurement")));

For(i = 1, i <= N Items(AllMeasurements), i++,

    If(Contains(AllMeasurements, "…"),

        gb << SendToReport(

Dispatch({}, "400", ScaleBox,

{Legend Model(1, Properties(i - 1, {Line Style("dotted")}))}

            )

        )

    )

);

For(i = 1, i <= N Items(AllMeasurements), i++,

    If(Contains(AllMeasurements, ".."),

        gb << SendToReport(

Dispatch({}, "400", ScaleBox,

{Legend Model(1, Properties(i - 1, {Line Style("DashDotDot")}))}

            )

        )

    )

);

For( i = 1, i <= N Items( AllMeasurements ), i++,

     If( Contains( AllMeasurements, "…" ),

          gb << SendToReport(

Dispatch(

{},

"400",

ScaleBox,

{Legend Model( 1, Properties( i - 1, {Line Color( 5 )} ) )}

)

)       

     )

);

For( i = 1, i <= N Items( AllMeasurements ), i++,

     If( Contains( AllMeasurements, "target" ),

          gb << SendToReport(

Dispatch(

{},

"400",

ScaleBox,

{Legend Model( 1, Properties( i - 1, {Line Color( 0 )} ) )}

)

          )

     )

);

//StackedData << show window(0);

//data << show window(0);

Jim
markschwab

Community Trekker

Joined:

Apr 15, 2016

Hi Jim, thanks for the response. Adding the "invisible" argument right into the stack command does streamline things.

The main problem actually seems to be upstream of my script, I have now discovered! Even if I use a completely empty script, the program I am using to interface with JMP unhides every currently-hidden data table. So, this was all just a red herring - my apologies! When I run the script only through JMP itself, I don't have the problem.