Subscribe Bookmark RSS Feed

Can't change focus to Current Data Table

twaintwist

Community Trekker

Joined:

Jun 14, 2012

I've created a summary table and now I'd like to manipulate the Summary Table and create a graph from it.....

2462_Logfile.jpg

But I can't seem to get the 'Current Data Table' command to work..... (see screenshot above)....

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

dt is not supposed to change here. The table variable dt still linked to the original table because you have not reassigned it.

In the code you assign the summary table to the table variable summary_table_name (you can use almost any name). To sort that table use

summary_table_name<< sort(...);


If you want to make jmp to forget dt and reuse that name for the summary table, try:

dt = dt << summary(...) ;

But that's not wise if you'll need to address the original table later in the script. Look

7 REPLIES
wiebepo

Community Trekker

Joined:

Oct 10, 2011

consider using the following syntax to give a handle to your summary table:

summary_table_name=dt<<Summary(Group(:SORTonTHIS));

dt<<Sort(By(:N Row), Order(Descending));

summary_table_name<<Graph Builder(...);

twaintwist

Community Trekker

Joined:

Jun 14, 2012

wiebepo --- thanks ----

It still is not switching to the Summary Table ---- it remains with the original datatable (which is called 'Script_temp') ---- you can see from the debug screen that 'dt' is still showing the original table and not the summary table after executing:  

               summary_table_name=dt<<Summary(Group(:SORTonTHIS));

2463_Debug.jpg

Solution

dt is not supposed to change here. The table variable dt still linked to the original table because you have not reassigned it.

In the code you assign the summary table to the table variable summary_table_name (you can use almost any name). To sort that table use

summary_table_name<< sort(...);


If you want to make jmp to forget dt and reuse that name for the summary table, try:

dt = dt << summary(...) ;

But that's not wise if you'll need to address the original table later in the script. Look

twaintwist

Community Trekker

Joined:

Jun 14, 2012

Thanks ---- Obviously I was confused --- thanks for clearing that up for me

twaintwist

Community Trekker

Joined:

Jun 14, 2012

I'm still having problems understanding what I can and can't do with a separate dataTable....

For the Summary table I've successfully created two new columns, populated another with data and now I'm  trying to concatenate two columns on the Summary table called 'ParetoTable'...

ParetoTable << For each Row(:ProductProblemCategory_=:Order || :ProductProblemCategory);

Nothing happens --- see log screenshot ------ but occasionally I get an error in the log saying that 'ProductProblemCategory_' is not an L-value...etc..

2464_Foreach.jpg

ms

Super User

Joined:

Jun 23, 2011

I don't think For Each Row() can be used as a message in the JSL syntax. Think of it as a function that applies to the current data table.

Try either to first make sure that PeretoTable is the current data table and then the row-wise concat:

ParetoTable=current data table();

for each row(ProblemProductCategory_ = :Order||:ProblemProductCategory);

Or use the dt:col syntax to explicitly address the columns:


for each row(ParetoTable:ProblemProductCategory_ = ParetoTable:Order||ParetoTable:ProblemProductCategory);

twaintwist

Community Trekker

Joined:

Jun 14, 2012

MS --- thanks ---- they both worked....