This is an old revision of the document!
Table of Contents
csmAddTotals - Constant sum matrix with row and column totals
The csmAddTotals function adds row or column totals to a constant sum matrix. If the question is configured to show row totals, csmAddTotals automatically adds column totals. If the question is configured to show column totals, csmAddTotals automatically adds row totals.
Functionality includes:
- Optionally display grand total
- Supports back button
- Automatically supports before and after symbols
- Automatically supports translations
Here is an example that adds row totals:
Here is an example that adds column totals with grand total turned off:
This function is available for a reasonable fee. Contact TomG on the Qualtrics Community to learn more.
Set-up Instructions
Add Function To Survey
Add the csmAddTotals function to the survey header to make it available to any question in the survey. Go to Look & Feel → General → Header edit →
and paste the provided csmAddTotals function JS:
<script>/*Paste csmAddTotals function JS here*/</script>
Alternatively, paste the mfCsSliders function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.
JavaScript Function Call
Add JS to call the mfCsSliders function to apply it to the Slider question as follows:
Qualtrics.SurveyEngine.addOnload(function() {
csmAddTotals(this);
});
To override the default options, specify the desired options in the second function argument as an object. For example:
Qualtrics.SurveyEngine.addOnload(function() {
csmAddTotals(this,{grandTotal:false});
});
Question Settings
- Matrix
- Matrix Type: Constant Sum
- Add Total Box: On
Options
grandTotal
grandTotal is a boolean that specifies if a grand total should be displayed.
Default: true
