User Tools

Site Tools


transformations:trimbycondition

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
transformations:trimbycondition [2015/05/01 13:33] elenaptransformations:trimbycondition [2023/10/05 00:34] (current) – [See also] dmitry
Line 1: Line 1:
-===== Trim Table by Condition =====+{{ transformations:TrimByConditionAction.png}} 
 +====== TRIM TABLE BY CONDITION ====== 
 +Category: Transform / Filters\\
  
-This transformation removes the rows above or below the first row where the specific condition is true.+\\  
 +=====Description===== 
 +This action removes the rows above or below the first row where the specific [[syntax:start|condition]] is true.\\
  
-EXAMPLE+\\  
 +=====Action settings===== 
 +^Setting ^Description ^ 
 +|Condition|Enter an expression that evaluates to TRUE or FALSE.| 
 +|Delete rows that are|Select whether the rows above or below the first match are removed.  Options: //Above first match// or //Below\\ first match//.| 
 +|Delete first matching row too|When checked, the first row that satisfies the //Condition// is removed as well as the rows above/below it.| 
 + 
 +\\  
 +=====Examples===== 
 +**Example:** Remove the rows with Montreal sales.\\
  
 **Table:** The company sales in the stores of Montreal and Toronto **Table:** The company sales in the stores of Montreal and Toronto
 +^ Store/ City  ^Jan-15  ^Feb-15  ^
 +| Store 1-Montreal  |  30359|  35018|
 +| Store 2-Montreal  |  24500|  28251|
 +| Store 3-Montreal  |  32721|  34300|
 +| **Total in Montreal**  |  **87580**|  **97569**|
 +| Store 1-Toronto  |  29800|  33691|
 +| Store 2-Toronto  |  37464|  40250|
 +| Store 3-Toronto  |  41238|  45390|
 +| **Total in Toronto**  |  **108502**|  **119331**|
 +\\ 
 +**Action parameters:**
 +> Condition is [Store/ City]='Total in Montreal'
 +> Delete rows that are "Above the first match"
 +> Delete the first matching row too (checked)
 +\\ 
 +**Result table:**
 +^Store/ City  ^Jan-15  ^Feb-15  ^
 +| Store 1-Toronto  |  29800|  33691|
 +| Store 2-Toronto  |  37464|  40250|
 +| Store 3-Toronto  |  41238|  45390|
 +| **Total in Toronto**  |  **108502**|  **119331**|
  
-^  Store/ City  ^  Jan-15  ^  Feb-15  ^ +\\  
-| Store 1-Montreal  |  30359  |  35018  | +====Community examples==== 
-| Store 2-Montreal  |  24500  |  28251  | +  * [[https://community.easymorph.com/t//2267/1|How to parse EDI file (e.g. X12 transaction set 837)]] ([[https://community.easymorph.com/uploads/short-url/6tzpyfamtKPeOq37FyUjBxKud4F.morph|Project]]; Module//Main//; Group//Header//; Table: //Raw header//; Action position: //2//) 
-| Store 3-Montreal  |  32721  |  34300  | +  * [[https://community.easymorph.com/t//2267/1|How to parse EDI file (e.g. X12 transaction set 837)]] ([[https://community.easymorph.com/uploads/short-url/6tzpyfamtKPeOq37FyUjBxKud4F.morph|Project]]; Module: //Main//; Group: //Raw EDI//; Table: //Raw EDI X12//; Action position: //5//
-**Total in Montreal**  |  **87580**  |  **97569** +  * [[https://community.easymorph.com/t//2711/2|My first experiment API + conditional workflow + iteration]] ([[https://community.easymorph.com/uploads/short-url/jG4qopOtRfSxDo0UFJkNbBaKvac.morph|Project]]; Module: //Main//; Group: //Acquisition data via API//; Table: //Data from API//; Action position: //5//)
-| Store 1-Toronto  |  29800  |  33691  | +
-Store 2-Toronto   37464  |  40250  | +
-| Store 3-Toronto  |  41238  |  45390  | +
-| **Total in Toronto**  |  **108502**  |  **119331** +
- +
- +
-**Objective:** Remove the rows with Montreal sales. +
- +
-**Transformation parameters:** +
-  * Condition: [StoreCity]=('Total in Montreal'+
-  * Delete rows that areAbove the first match +
-  * Delete the first matching row too (check the box)+
  
-**Result:**+\\  
 +=====See also===== 
 +  [[transformations:keepremovematching|Keep/remove matching]] 
 +  [[transformations:trimtable|Trim table]]
  
-^  Store/ City  ^  Jan-15  ^  Feb-15  ^ 
-| Store 1-Toronto  |  29800  |  33691  | 
-| Store 2-Toronto  |  37464  |  40250  | 
-| Store 3-Toronto  |  41238  |  45390  | 
-| **Total in Toronto**  |  **108502**  |  **119331**  | 
transformations/trimbycondition.1430501616.txt.gz · Last modified: 2015/05/01 13:33 by elenap

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki