cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
saitcopuroglu
Level IV

Tabulate»Make Into Data Table, Local Data Filter Does Not Take Effect (with JSL)

Hi,

The task is preparing everyday the daily sales of actual day.

Task is first completed by Tabulate (because of aggregate statistics) and then taken into Data Table and later updated with other data tables...etc...

Tabulate has local data filter but when scripting it to data table the local data filter does not take effect.

Any ideas, JSL mistakes, solutions?

Many thanks in advance

dtdaily = Data Table( "AgencyStayISL_LBL_Daily_Summary" );

tab = dtdaily << Tabulate(

    Remove Column Label( Grouping Columns( :month ) ),

    Show Control Panel( 0 ),

    Uniform plot scale( 0 ),

    Set Format( Sum( :NetRevenue( 22, 0 ) ) ),

    Add Table(

        Column Table( Analysis Columns( :NetRevenue ), Statistics( Sum, Column % ) ),

        Column Table( Analysis Columns( :AdultNight, :FreeChildNight ), Statistics( Sum ) ),

        Column Table( Analysis Columns( :RoomNight ), Grouping Columns( :month ), Add Aggregate Statistics( :month ), Statistics( Sum ) ),

        Row Table( Grouping Columns( :Resort, :MARKETS, :Agency Code ), Add Aggregate Statistics( :Resort, :MARKETS, :Agency Code ) )

    ),

    Local Data Filter(

        Add Filter(

            columns( :StayType, :Record Date ),

            Where( :StayType == {1, 2, 3} ),

            Where( :Record Date == Today() ),

            Display( :StayType, Size( 142, 78 ), Check Box Display )

        )

    )

);

dt_sum = tab << Make Into Data Table;

dt_sum << Set Name( "Daily Sum" );


11047_Screen Shot 2016-02-23 at 12.05.34.png

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp
Level X

Re: Tabulate»Make Into Data Table, Local Data Filter Does Not Take Effect (with JSL)

This appears to be a timing issue of some kind.

These are now rare in my experience, but when they do occur inserting a 'Wait(0)' generally fixes things. But, in this case, to force 'make Into Data Table' to respect the current report state (as defined by the Local Data Filter), I had to insert a short, but non-zero, delay:

NamesDefaultToHere(1);

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

tab = dt << Tabulate(

Show Control Panel( 0 ),

Add Table(

Column Table( Analysis Columns( :height ), Statistics( Mean ) ),

Row Table( Grouping Columns( :sex ) )

),

Local Data Filter( Add Filter( columns( :age ), Where( :age == {15, 16, 17} ) ) )

);

Wait(0.1);

dtTab = tab << makeIntoDataTable;

View solution in original post

1 REPLY 1
ian_jmp
Level X

Re: Tabulate»Make Into Data Table, Local Data Filter Does Not Take Effect (with JSL)

This appears to be a timing issue of some kind.

These are now rare in my experience, but when they do occur inserting a 'Wait(0)' generally fixes things. But, in this case, to force 'make Into Data Table' to respect the current report state (as defined by the Local Data Filter), I had to insert a short, but non-zero, delay:

NamesDefaultToHere(1);

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

tab = dt << Tabulate(

Show Control Panel( 0 ),

Add Table(

Column Table( Analysis Columns( :height ), Statistics( Mean ) ),

Row Table( Grouping Columns( :sex ) )

),

Local Data Filter( Add Filter( columns( :age ), Where( :age == {15, 16, 17} ) ) )

);

Wait(0.1);

dtTab = tab << makeIntoDataTable;