QScript WeightCategoryValueRef

From Q
Jump to navigation Jump to search

WeightCategoryValueRef

References a category by its numeric value. This is the category's source value as it appears in the data file, before any Value Attributes remap — not a user-edited label. Enumerate the available values for a Pick One question via question.uniqueValues. For a Date/Time question this is accepted as a convenience: the value is the period's start expressed as milliseconds since the JavaScript epoch (1970-01-01), and the wrapper resolves it to the matching period. Because a date period's start can shift when the data is refreshed, filtered, or the aggregation changes, prefer WeightCategoryDateRef for date categories. A value that matches no current period is rejected rather than silently dropped.

categoryValue

The numeric source value of the referenced category (the raw data-file value, pre-Value-Attribute remap; enumerate via question.uniqueValues for a Pick One question). For a Date/Time question, the period start in milliseconds since the epoch.

question

The question that owns the referenced category.

type

Returns the name we use to refer to this class in the documentation.