Subscribe Bookmark RSS Feed

Renaming and/or saving data tables

saitcopuroglu

Community Trekker

Joined:

Sep 29, 2014

I create a data table through tabulate and need to do further reports on that data table but each time it gives a name to data table "untitled XXX" (in this case untitled 14) . And since I need to automate the reporting and need to do it several times a day I need a "fixed name" for that data table  (and further save or not). How will I do it?

Thanks for your help

(Data Table( "AgencyStayISL.jmp" ) << Tabulate(

  Show Control Panel( 0 ),

  Uniform plot scale( 0 ),

  Add Table(

  Column Table(

  Analysis Columns(

  :RoomNight,

  :AdultNight,

  :PaidChildNight,

  :FreeChildNight,

  :BabyNight,

  :ArrivalRoom,

  :ArrivalAdult,

  :ArrivalFreeChild,

  :ArrivalPaidChild,

  :ArrivalBaby

  ),

  Statistics( Sum )

  ),

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

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

  Row Table( Grouping Columns( :Year, :Month, :day ) )

  )

)) << Make Into Data Table

8373_Screen Shot 2015-03-15 at 13.02.19.png

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz

Super User

Joined:

Jun 23, 2011

Solution

A couple of recommendations:

1. Use a table variable instead of referring to a table by name.

2. Include the invisible keyword for the tabulation.  Less flashy-thingy effect

3. Use set name("new name") to change the name of the untitled table

Try the following code:

dt1 = Data Table( "AgencyStayISL" );

dtab = dt1 << Tabulate(

     Show Control Panel( 0 ),

     Uniform plot scale( 0 ),

     Add Table(

           Column Table(

                Analysis Columns(

                     :RoomNight,

                     :AdultNight,

                     :PaidChildNight,

                     :FreeChildNight,

                     :BabyNight,

                     :ArrivalRoom,

                     :ArrivalAdult,

                     :ArrivalFreeChild,

                     :ArrivalPaidChild,

                     :ArrivalBaby

                ),

                Statistics( Sum )

           ),

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

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

           Row Table( Grouping Columns( :Year, :Month, :day ) )

     ),

     invisible

);

dt2 = dtab << Make Into Data Table;

dt2 << set name( "My Data Table Name" );

1 REPLY
pmroz

Super User

Joined:

Jun 23, 2011

Solution

A couple of recommendations:

1. Use a table variable instead of referring to a table by name.

2. Include the invisible keyword for the tabulation.  Less flashy-thingy effect

3. Use set name("new name") to change the name of the untitled table

Try the following code:

dt1 = Data Table( "AgencyStayISL" );

dtab = dt1 << Tabulate(

     Show Control Panel( 0 ),

     Uniform plot scale( 0 ),

     Add Table(

           Column Table(

                Analysis Columns(

                     :RoomNight,

                     :AdultNight,

                     :PaidChildNight,

                     :FreeChildNight,

                     :BabyNight,

                     :ArrivalRoom,

                     :ArrivalAdult,

                     :ArrivalFreeChild,

                     :ArrivalPaidChild,

                     :ArrivalBaby

                ),

                Statistics( Sum )

           ),

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

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

           Row Table( Grouping Columns( :Year, :Month, :day ) )

     ),

     invisible

);

dt2 = dtab << Make Into Data Table;

dt2 << set name( "My Data Table Name" );