Subscribe Bookmark RSS Feed

Insert Current Date in Output Table

Risslemc

Occasional Contributor

Joined:

Apr 26, 2017

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
pmroz

Super User

Joined:

Jun 23, 2011

Solution

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);
3 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

Solution

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);
Risslemc

Occasional Contributor

Joined:

Apr 26, 2017

Thanks pmroz, that works!!!
txnelson

Super User

Joined:

Jun 22, 2012

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