Capping a weight refers to limiting the maximum value that a weight can take. For example, where weights are capped at 5 it means that any weight computed to be greater than 5 is returned as 5.
Requirements
- A weight variable
Method
- In the Data Sources tree, hover over any variable and select + > Custom Code > JavaScript > Numeric.
- Add appropriate entries for Name and Label in the General tab in Properties
.
-
In the Code
panel, paste the following:
Math.min(maxValue,weightVariable)where weightVariable is the name of the variable that is the current weight, and maxValue is the maximum value that you wish the weight to take (i.e., the cap).
- Tick Data > Attributes > Usable as a weight for the new weight variable in Properties
.
- Apply the newly created weight to any tables and/or charts to be weighted.
Next
How to Use Frequency Weights in Displayr
How to Make Merged Categories Appear in Targets When Weighting
UPCOMING WEBINAR: From Chat to Agents: The New Phase of AI in Market Research