Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
Risslemc
Level II

Insert Current Date in Output Table

JSL Gurus!

 

I need your help trying to change the name of a JOIN output table.

 

I'm in the process of scripting a JOIN from last month's file and this month's file. I'd like the output to be renamed to "Main Table" and the current month (201706).

 

Ex: "Main Table 201706"

 

Is this possible?

 

To be discussed later, when I get to next month I'll make that new file (Main Table 201706) the current dt, join 201707 and output table "Main Table 201707" and so on...

 

Any help is appreciated!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
pmroz
Super User

Re: Insert Current Date in Output Table

Here's one way to do it.  I created a little table to use as an example.

dt = New Table( "Untitled 10", Add Rows( 2 ), 
		New Column( "Column 1", Numeric, Continuous, Format( "Best", 12 ),
		Set Values( [1, 2] )
	)
);

tbl_name = "Main Table " || substr(format(today(), "yyyymmdd"), 1, 6);

dt << set name(tbl_name);

View solution in original post

3 REPLIES 3
Highlighted
pmroz
Super User

Re: Insert Current Date in Output Table

Here's one way to do it.  I created a little table to use as an example.

dt = New Table( "Untitled 10", Add Rows( 2 ), 
		New Column( "Column 1", Numeric, Continuous, Format( "Best", 12 ),
		Set Values( [1, 2] )
	)
);

tbl_name = "Main Table " || substr(format(today(), "yyyymmdd"), 1, 6);

dt << set name(tbl_name);

View solution in original post

Highlighted
Risslemc
Level II

Re: Insert Current Date in Output Table

Thanks pmroz, that works!!!
txnelson
Super User

Re: Insert Current Date in Output Table

FYI,

The 

dt << set name(tbl_name);

message and all other data table messages that are available are documented with examples in:

     Help==>Scripting Index

And to be more specific your question

     Help==>Scripting Index==>Data Table

Jim
Article Labels

    There are no labels assigned to this post.