Subscribe Bookmark RSS Feed

Table Summary

By using table summary, I can get the max values of a column.

If I also want to find the vlaues of other columns correspomding to the same row of the max values of a specified column, is there a function JSL has for this purpose?

For example, column D has max of 100 at row 10. Then I want to know the value of column A at row 10. What function can I use in my script?

Thanks a lot for help.

If you know the index value of the row like you said row 10, you can then pull the data using column[10]. Here is some syntax:

col = Column( Current Data Table(), As Name( "A" ) );
val = col[ 10 ]
print( val )

This isn't a specific function, but I think it will accomplish what you are looking for.

Good Luck!
I am sorry I did not state it clearly.

By doing the summary, I can get the max value of 100 in column D. I need to know which row in column D has the max value of 100. Then I want to get the value of column A in that row which has the max value of 100 in column D.

Thanks a lot for your help.



Jun 23, 2011

we know that the summary table and the source table (the original table) are linked by row states.
If we select a row in the summary table, the corresponding rows in the source table will be selected. so maybe you can do something like this :

dt = current data table();
summary = dt << Summary( Group( summarycolumn ) );
n = nrows(summary);
for (i=1, i summary << select rows (i);
theRows = (dt << getselectedrows());
// now theRows has the rows for group i, do whatever you want with it.
dt << clear select;