User Tools

Site Tools


transformations:trimbycondition

TRIM TABLE BY CONDITION

Category: Transform / Filters


Description

This action removes the rows above or below the first row where the specific condition is true.


Use cases

  • Remove records that occurred before or after a specific date.
  • Remove records of system events that happened before an error occurred, keeping the events that happened after the error.
  • Determine the effect of a sale by removing sales data prior to the sale and focusing on the post-sale data.
  • Remove rows after a specific situation occurs, keeping the steps that happened leading up to the situation.


Action settings

Setting Description
ConditionEnter an expression that evaluates to TRUE or FALSE.
Delete rows that areSelect whether the rows above or below the first match are removed. Options: Above first match or Below
first match
.
Delete first matching row tooWhen checked, the first row that satisfies the Condition is removed as well as the rows above/below it.


Examples

Example #1

Remove the rows with Montreal sales.

Before (source table)

Store/ City Jan-15 Feb-15
St#1-Montreal 30359 35018
St#2-Montreal 24500 28251
Total Montreal 87580 97569
St#1-Toronto 29800 33691
St#2-Toronto 37464 40250
Total Toronto 108502 119331

After (result table)

Store/ City Jan-15 Feb-15
St#1-Toronto 29800 33691
St#2-Toronto 37464 40250
Total Toronto 108502 119331

Action parameters

Condition: [Store/City]="Total Montreal"
Delete rows that are: Above first match
Delete the first matching row too


Example #2

Remove records after the system error occurred to focus on the steps that may have caused it.

Before (source table)

Timestamp Log Message
10:00 AM System Start
10:05 AM User Login
10:10 AM Database Connected
10:15 AM ERROR: Connection Lost
10:20 AM Retrying Connection

After (result table)

Timestamp Log Message
10:00 AM System Start
10:05 AM User Login
10:10 AM Database Connected
10:15 AM ERROR: Connection Lost

Action parameters

Condition: [Log Message]="ERROR: Connection Lost"
Delete rows that are: Below first match


Community examples


See also

transformations/trimbycondition.txt · Last modified: 2025/01/31 21:57 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki