User Tools

Site Tools


transformations:filterminmax

Differences

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

Link to this comparison view

Next revision
Previous revision
transformations:filterminmax [2018/08/15 08:44] – created dmitrytransformations:filterminmax [2023/10/05 00:35] (current) – [See also] dmitry
Line 1: Line 1:
-===== Keep min/max =====+{{ transformations:FilterMinMaxAction.png}} 
 +====== KEEP MIN/MAX=====
 +Category: Transform / Filters\\
  
-This action keeps (removes) only rows with values that are the biggest (smallestin specified column.+\\  
 +=====Description===== 
 +This action keeps (or removes) only rows with values that are the biggest or smallest in specified column.\\
  
-**Example**+\\ 
 +=====Use cases===== 
 +Use this action to generate datasets of "top N" or "bottom N" (or "top %" or "bottom %") records based on values in a specific column.
  
-TableBefore+\\  
 +=====Action settings===== 
 +^Setting ^Description ^ 
 +|Column|Select the column to filter values on.| 
 +|Keep or remove?|Select whether keep or remove the highest/lowest values.  Options //Keep// or //Remove//.| 
 +|Biggest or smallest?|Select whether to keep/remove the largest values, or the smallest.  Options:  //Biggest// or //Smallest//.| 
 +|How many (numbers/dates)?<sup>*</sup>|Select whether to keep/remove a specific number of values (e.g. "3" for the top/bottom three values), or a\\ percentage (e.g. "10" for the top/bottom 10% of values).  Options: //Count// or //Percent//.| 
 +|Inside groups|When checked, the min/max process will operate within groups of values in the column(s) selected (and select the column(s)).| 
 +<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\ 
 + 
 +\\ 
 +=====Remarks===== 
 +Taking into account ties, the number of rows returned by this action may exceed the "Count" value entered.  The "Count" value refers to the number of unique values, not the number of rows. 
 + 
 + 
 +\\  
 +=====Examples===== 
 +**Example:** Obtain the products with the lowest three prices.\\ 
 + 
 +**Source table:**
 ^ Product ^ Price, USD ^ ^ Product ^ Price, USD ^
 |A |  12| |A |  12|
Line 13: Line 38:
 |E |  13| |E |  13|
 |F |   9| |F |   9|
 +\\ 
 +**Action parameters:**
 +> Column is "Price, USD"
 +> "Keep" the "Smallest"
 +> Count is "3"
  
-Goal: obtain products with the lowest 3 prices. +\\  
- +**Result table:**
-TableAfter+
 ^ Product ^ Price, USD ^ ^ Product ^ Price, USD ^
 |A |  12| |A |  12|
Line 22: Line 51:
 |E |  13| |E |  13|
 |F |   9| |F |   9|
 +Although the "Count" value was "3", four rows were returned due to the duplicate value "13" in two rows.\\
 +
 +\\ 
 +====Community examples====
 +  * [[https://community.easymorph.com/t//1332/3|String manipulation (REVERSE)]] ([[https://community.easymorph.com/uploads/short-url/67c52KIJt323kknw2Q4vOvlAJ05.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Using actions//; Action position: //5//)
 +  * [[https://community.easymorph.com/t//2156/1|How to process parent-child data structures]] ([[https://community.easymorph.com/uploads/short-url/zmylfn4Qr0ovzu3e5rybl0LVMNG.morph|Project]]; Module: //Module 1//; Group: //Tab 1//; Table: //Longest folder path//; Action position: //4//)
 +
 +\\ 
 +=====See also=====
 +  * [[transformations:trimtable|Trim table]]
transformations/filterminmax.1534337090.txt.gz · Last modified: 2018/08/15 08:44 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki