User Tools

Site Tools


transformations:keeptop

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
transformations:keeptop [2014/10/25 17:19] – created dmitrytransformations:keeptop [2015/04/10 12:45] elenap
Line 1: Line 1:
 ===== Keep Top Rows ===== ===== Keep Top Rows =====
  
-This transformation leaves only first N rows and removes all other rows.+This transformation keeps only first N rows and removes all other rows.
  
 If you need to remove bottom rows -- add line numbers using [[transformations:enumerate|Enumerate Rows]], sort backwards by row numbers using [[transformations:sort|Sort]] and then apply Keep Top Rows. If you need to remove bottom rows -- add line numbers using [[transformations:enumerate|Enumerate Rows]], sort backwards by row numbers using [[transformations:sort|Sort]] and then apply Keep Top Rows.
  
 +EXAMPLE
 +
 +**Source table:** The longest rivers in the world
 +
 +^  River  ^  Length (km)  ^  Continent  ^
 +| Nile  |  6650  |  Africa  |
 +| Amazon  |  6400  |  South America  |
 +| Yangtze  |  6300  |  Asia  |
 +| Mississippi  |  6275  |  North America  |
 +| Yenisei  |  5539  |  Asia  |
 +| Yellow River  |  5464  |  Asia  |
 +| Ob  |  5410  |  Asia  |
 +| Paraná  |  4880  |  South America  |
 +
 +
 +**Objective:** Keep the three top rows in the table
 +
 +**Transformation parameters:**
 +  * Number of rows: 3
 +
 +**Output table:**
 +
 +^  River  ^  Length (km)  ^  Continent  ^
 +| Nile  |  6650  |  Africa  |
 +| Amazon  |  6400  |  South America  |
 +| Yangtze  |  6300  |  Asia  |

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki