In this article
1: Summary
The table dimension transform creates a table where each row represents a dimension from a specified dimensionGroup. It’s commonly used to calculate and output scores (like averages) or categorical values for each dimension.
This is useful for dashboards, scoring models, or any structured reporting based on grouped survey content.
2: Declaring the Table
table dimension #yourTableName {
parent: .yourParentTable:
dimensionGroup: @yourDimensionGroup
action create {
// variables here
}
}2.1: Key Properties
| Property | Description |
| parent | The table where the new dimension table will be created (typically .response: or a loop level).
|
| dimensionGroup | A reference to a dimensionGroup entity. Determines which dimensions will be included.
|
3: Creating Variables
Inside action create, you define one or more variables to be calculated per dimension:
action create {
variable numeric #dimensionScoreValue {
value: dimensionAvg()
required: true
totalDigits: 7
decimals: 6
}
}3.1: Example: Three-Point Distribution
You can also recode the average score into a simpler scale:
variable singleChoice #threePoint {
value: recode(dimensionScore:dimensionScoreValue, @dimension3point)
label: "Distribution"
required: true
option code { code: "3", label: "Unfavorable" }
option code { code: "2", label: "Neutral" }
option code { code: "1", label: "Favorable" }
}4: Using numericlist Fields
You can also define numericlist variables to break down count distributions per dimension:
variable numericlist #favCounts {
totalDigits: 5
decimals: 0
field {
code: "3"
label: "Unfavorable"
value: sum(iif(score(dimensionItems()) <= 2, 1, 0))
}
// Additional fields...
}5: Example: Full Dimension Table
table dimension #dg1_dimensionScore {
parent: .response:
dimensionGroup: @dg1
action create {
variable numeric #dimensionScoreValue {
value: dimensionAvg()
required: true
totalDigits: 7
decimals: 6
}
variable singleChoice #threePoint {
value: recode(dimensionScore:dimensionScoreValue, @dimension3point)
label: "Distribution"
required: true
option code { code: "3", label: "Unfavorable" }
option code { code: "2", label: "Neutral" }
option code { code: "1", label: "Favorable" }
}
variable numericlist #favCounts {
totalDigits: 5
decimals: 0
field { code: "3", label: "Unfavorable", value: sum(iif(score(dimensionItems()) <= 2, 1, 0)) }
field { code: "2", label: "Neutral", value: sum(iif(score(dimensionItems()) = 3, 1, 0)) }
field { code: "1", label: "Favorable", value: sum(iif(score(dimensionItems()) >= 4, 1, 0)) }
}
}
}6: Best Practices
Always declare dimensionAvg()first in the variable list. This ensures compound dimensions are calculated correctly.
Keep dimensionGroup logic centralized to ensure consistency across tables.
Use recode() and numericlist for simplified reporting.