transformations:createbuckets
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
transformations:createbuckets [2020/11/27 17:19] – created dmitry | transformations:createbuckets [2021/07/19 02:29] (current) – [Examples] craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Create Buckets | + | {{ transformations: |
+ | ====== | ||
+ | Category: Transform / Advanced\\ | ||
- | Creates numerical ranges of fixed width and assigns each row to one of the ranges based on values in specified column. | + | \\ |
+ | =====Description===== | ||
+ | Creates numerical ranges of fixed width and assigns each row to one of the ranges based on values in the specified column.\\ | ||
- | The action is typically used for grouping number values (such as age) by intervals of fixed width (e.g. age group). Created group labels can later be used in reports and charts. | + | \\ |
+ | =====Use cases===== | ||
+ | The action is typically used for grouping number values (such as age or tenure) by intervals of fixed width (e.g. age group). Created group labels can later be used in reports and charts.\\ | ||
- | **Example** | + | \\ |
+ | =====Action settings===== | ||
+ | ^Setting^Description^ | ||
+ | |Column|Select the column containing the values to create buckets for.| | ||
+ | |Bucket column name|Enter a name for the new column containing the bucket range values.| | ||
+ | |Bottom threshold< | ||
+ | |Bucket width< | ||
+ | |Upper threshold< | ||
+ | |Mode|Options: | ||
+ | |Label style|Select the format the bucket labels will appear in. Options: | ||
+ | |Add columns with lower/upper boundaries|When selected, an additional column named //Lower boundary// will be created to hold the lower boundary\\ values of the buckets, and a column named //Upper boundary// will be created to hold the upper boundary values of the buckets.| | ||
+ | |Generate empty rows for empty buckets|When checked, will generate rows for all bucket ranges in which a value did not fall (" | ||
+ | <sup>*</ | ||
+ | \\ | ||
+ | ====Mode settings==== | ||
+ | ^Mode^Description^ | ||
+ | |Lower boundary inclusive, | ||
+ | |Lower boundary exclusive, | ||
- | Table before: | + | \\ |
- | ^ Age ^ | + | =====Remarks===== |
- | | 23| | + | As bucket ranges reuse values for upper and lower boundaries, the //Mode// determines where a value that falls //on// a boundary ends up. For example, a value of " |
- | | 29| | + | |
- | | 19| | + | |
- | | 34| | + | |
- | | 35| | + | |
- | | 41| | + | |
- | Objective: create buckets of 10 year width and assign a bucket to each age. | + | Values that fall into the "less than..." |
- | Table after: | + | This process is also called " |
- | ^ Age ^ | + | |
- | | | + | \\ |
- | | | + | =====Examples===== |
- | | | + | **Example: |
- | | | + | |
- | | | + | **Table 1:** Age list (sorted for clarity). |
- | | | + | ^Age ^ |
+ | | 18| | ||
+ | | 21| | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | 72| | ||
+ | | 80| | ||
+ | | 81| | ||
+ | | 96| | ||
+ | \\ | ||
+ | **Action parameters: | ||
+ | > Column is " | ||
+ | > Bucket column name is "Age Ranges" | ||
+ | > Bottom threshold is " | ||
+ | > Bucket width is "10" | ||
+ | > Upper threshold is " | ||
+ | > Mode is "lower exclusive, upper inclusive" | ||
+ | > Label style is "0 to 10, less than 0, greater than 10" | ||
+ | > Add columns with lower/upper boundaries is checked. | ||
+ | > Generate empty rows for empty buckets is checked. | ||
+ | |||
+ | \\ | ||
+ | **Result table:** | ||
+ | |||
+ | ^Age ^Age Ranges | ||
+ | | 18|less than 30 | | 30| | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | 50|40 to 50 | 40| 50| | ||
+ | | 55|50 to 60 | 50| 60| | ||
+ | | 65|60 to 70 | 60| 70| | ||
+ | | 72|70 to 80 | 70| 80| | ||
+ | | 80|70 to 80 | 70| 80| | ||
+ | | 81|greater than 80 | 80| | | ||
+ | | 96|greater than 80 | 80| | | ||
+ | Notice that values that fall //on// the upper boundary are included within that range due to the "lower exclusive, upper __inclusive__" | ||
+ | |||
+ | There were no unused buckets, so no extra rows were produced.\\ | ||
+ | |||
+ | \\ | ||
+ | =====See also===== | ||
+ | * [[transformations: | ||
transformations/createbuckets.txt · Last modified: 2021/07/19 02:29 by craigt