transformations:intervalmerge
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
transformations:intervalmerge [2018/08/15 09:15] – created dmitry | transformations:intervalmerge [2021/07/19 02:24] (current) – [Examples] craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Interval merge ===== | + | {{ transformations: |
+ | ====== | ||
+ | Category: Transform / Advanced \\ | ||
+ | \\ | ||
+ | =====Description===== | ||
This action merges two tables based on whether a value in one table falls into a range specified by two values in another table. | This action merges two tables based on whether a value in one table falls into a range specified by two values in another table. | ||
- | **Example** | + | The lower boundary of a range is inclusive, the upper is exclusive. Ranges can overlap. In such cases, one row for each match will be inserted into the resulting table.\\ |
- | Table 1: Boundaries | + | \\ |
- | ^ Lower ^ Upper ^ Feels ^ | + | =====Use cases===== |
- | | 0| | + | //Interval merge// can be used to to categorize or " |
- | | | + | |
- | | | + | |
- | Table 2: Temperature in Toronto | + | This action is a good substitute for a [[transformations: |
- | ^Month ^High, C^ | + | |
+ | \\ | ||
+ | =====Action settings===== | ||
+ | ^Setting^Description^ | ||
+ | |Merge table|Select the table to merge with the current dataset.| | ||
+ | |Columns|Select whether to merge all columns in the second dataset, or just selected columns. | ||
+ | The reference to the second table will appear as a dotted line connecting this action to the second dataset in the application window.\\ | ||
+ | |||
+ | \\ | ||
+ | =====Remarks===== | ||
+ | To create a lookup set that doesn' | ||
+ | |||
+ | ^Low ^High ^Label | ||
+ | | 0| 4| Range is 0 to __3__| | ||
+ | | 4| 8| Range is 4 to __7__ (don't start with " | ||
+ | | 8| 11| Range is 8 to __10__. (range end is " | ||
+ | \\ | ||
+ | A lookup pair (low, high) cannot have a " | ||
+ | \\ | ||
+ | //Interval merge// can also use text-based lookup ranges and values (see Example 2, below).\\ | ||
+ | |||
+ | \\ | ||
+ | =====Examples===== | ||
+ | |||
+ | **Example 1:** Find what it feels like in Toronto during the year.\\ | ||
+ | |||
+ | **Table 1:** Temperature in Toronto | ||
+ | ^Month ^Temp High (C)^ | ||
|Jan | | |Jan | | ||
|Feb | | |Feb | | ||
Line 26: | Line 55: | ||
|Dec | | |Dec | | ||
- | Goal: find what it feels like in Toronto during a year. | + | **Table 2:** Boundaries |
- | + | ^ Lower ^ Upper ^ Feels ^ | |
- | Solution: merge using the "Interval merge" | + | | 0| |
- | + | | | |
- | Table: | + | | |
+ | \\ | ||
+ | **Action parameters:** | ||
+ | > Table to merge is "Table 2" | ||
+ | > Values | ||
+ | > Are greater than or equal to "Lower" (in Table 2) | ||
+ | > And less than "Upper" (in Table 2) | ||
+ | \\ | ||
+ | **Result | ||
^Month ^High, | ^Month ^High, | ||
|Jan | | |Jan | | ||
Line 45: | Line 82: | ||
|Dec | | |Dec | | ||
+ | \\ | ||
+ | \\ | ||
+ | **Example 2:** Use a letter-based merge to assign Names to letter ranges. | ||
+ | |||
+ | **Table 1:** Names | ||
+ | ^Name ^ | ||
+ | |Mary | | ||
+ | |Sally | ||
+ | |Bob | | ||
+ | |Max | | ||
+ | |Bruce | ||
+ | |Tammy | ||
+ | |Chris | ||
+ | |Frank | ||
+ | |Zeek | | ||
+ | |||
+ | **Table 2:** Lookup ranges | ||
+ | ^Low ^High ^Label | ||
+ | |A |F |Range A-E | | ||
+ | |F |L |Range F-K | | ||
+ | |L |S |Range L-R | | ||
+ | |S |Z |Range S-Y | | ||
+ | |Z |Zz |Range Z | | ||
+ | The high value of " | ||
+ | |||
+ | \\ | ||
+ | **Action parameters: | ||
+ | > Table to merge is "Table 2" | ||
+ | > Values in column " | ||
+ | > Are greater or equal to " | ||
+ | > And less than " | ||
+ | > Columns to merge is " | ||
+ | \\ | ||
+ | **Result table:** | ||
+ | ^Name ^Label | ||
+ | |Mary |Range L-R | | ||
+ | |Sally | ||
+ | |Bob |Range A-E | | ||
+ | |Max |Range L-R | | ||
+ | |Bruce | ||
+ | |Tammy | ||
+ | |Chris | ||
+ | |Frank | ||
+ | |Zeek |Range Z | | ||
+ | |||
+ | \\ | ||
+ | ====Community examples==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | \\ | ||
+ | =====See also===== | ||
+ | * [[transformations: | ||
+ | * [[transformations: | ||
+ | * [[transformations: | ||
transformations/intervalmerge.1534338921.txt.gz · Last modified: 2018/08/15 09:15 by dmitry