User Tools

Site Tools


transformations:intervalmerge

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
transformations:intervalmerge [2020/12/02 15:32] dmitrytransformations:intervalmerge [2021/04/10 22:00] craigt
Line 1: Line 1:
-===== Interval merge =====+{{ transformations:IntervalMergeAction.png}} 
 +====== INTERVAL MERGE ====== 
 +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.
  
-The lower boundary of a range is inclusive, the upper is exclusive. Ranges can overlap, in this case one row for each match will be inserted into the resulting table.+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.\\
  
-**Example**+\\ 
 +=====Use cases===== 
 +//Interval merge// can be used to to categorize or "bucket" values in a dataset that fall within a given range or scale, such as survey responses (1-3 = "bad", 4-6 = "neutral", 7-10 = "good"), temperature ranges, size scales, etc.
  
-Table 1Boundaries +This action is a good substitute for a [[transformations:lookup|Lookup]] action that uses multiple lookup values with similar return values (e.g., 1="good", 2="good", 3="neutral", 4="bad", 5="bad).
-^ Lower ^ Upper ^ Feels ^ +
-|      0|     15|Cold    | +
-|     15|     25|Comfortable | +
-|     25|     99|Hot   |+
  
-Table 2: Temperature in Toronto (Celsius) +\\  
-^Month ^HighC^+=====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.  Options:  //All columns// or\\ //Selected columns// (choose which columns to include in the merge).| 
 +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't contain any "gaps" be sure to set the "less than" value one higher than the last value you want included in the range, and start the //following// pairing with that same value. 
 + 
 +^Low  ^High  ^Label 
 +|  0|  4| Range is 0 to __3__| 
 +|  4|  8| Range is 4 to __7__ (don't start with "5" or you'll lose "4")| 
 +|  8|  11| Range is 8 to __10__. (range end is "10" as "11" is excluded)| 
 + 
 +\\  
 +=====Examples===== 
 + 
 +**Objective:**  Find what it feels like in Toronto during the year.\\ 
 + 
 +**Table 1:** Temperature in Toronto (Celsius) 
 +^Month ^Temp High (C)^
 |Jan |   0| |Jan |   0|
 |Feb |   0| |Feb |   0|
Line 28: Line 51:
 |Dec |   3| |Dec |   3|
  
-Goalfind what it feels like in Toronto during a year. +**Table 2:** Boundaries 
- +^ Lower ^ Upper ^ Feels ^ 
-Solution: merge using the "Interval mergeaction where [Temperature in Toronto] is between [Lower] and [Upper]. +|      0|     15|Cold    | 
- +|     15|     25|Comfortable | 
-Table: Result+|     25|     99|Hot   | 
 +\\  
 +**Action parameters:** 
 +> Table to merge is "Table 2" 
 +> Values in column (Table 1) is "Temp High (C)" 
 +> Are greater than or equal to "Lower" (in Table 2) 
 +> And less than "Upper" (in Table 2) 
 +\\  
 +**Result:**
 ^Month ^High, C^ Feels ^ ^Month ^High, C^ Feels ^
 |Jan |   0|Cold  | |Jan |   0|Cold  |
Line 47: Line 78:
 |Dec |   3|Cold  | |Dec |   3|Cold  |
  
- +\\  
-** See also **+=====See also=====
   * [[transformations:merge|Merge another table]]   * [[transformations:merge|Merge another table]]
-  * [[https://community.easymorph.com/t/assign-value-from-conditions-based-on-a-table/2292|Downloadable example #1]] +  * [[https://community.easymorph.com/t/assign-value-from-conditions-based-on-a-table/2292|Community: Assign value from conditions based on a table (with downloadable example)]] 
-  * [[https://community.easymorph.com/t/example-of-using-interval-merge/1851|Downloadable example #2]] +  * [[https://community.easymorph.com/t/example-of-using-interval-merge/1851|Community: Example of using Interval Merge (with downloadable example)]] 
-  * [[https://community.easymorph.com/t/rules-on-2-or-more-tables/952|Downloadable example #3]]+  * [[https://community.easymorph.com/t/rules-on-2-or-more-tables/952|Community: Rules on 2 or more tables (with downloadable example)]]
transformations/intervalmerge.txt · Last modified: 2021/07/19 02:24 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki