Constant sum matrix table - have a total for both rows and columns | XM Community
Skip to main content
Question

Constant sum matrix table - have a total for both rows and columns

  • July 12, 2019
  • 6 replies
  • 261 views

I know the standard constant sum matrix question lets you have a total colum for either rows or columns, but is there a way you can have an automatic total appearing at both the bottom of rows and across columns? I've searched the community but can't seem to find an answer to this question.

6 replies

Forum|alt.badge.img+2
@StarchySquid did you ever get a solution for this?

JoycaV
QPN Level 4 ●●●●
Forum|alt.badge.img+27
  • QPN Level 4 ●●●●
  • December 13, 2019
I'd also like to know this

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • December 13, 2019
There isn't a built-in way to do this, but you can write JavaScript to do it.

Forum|alt.badge.img+1
  • February 25, 2020
I'd also like to know the code. Anyone (@TomG) who has the code for this?

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • February 25, 2020
> @ahra1120 said: > I'd also like to know the code. Anyone (@TomG) who has the code for this? I don't. I've never had the need for it myself. It wouldn't be too difficult to create.

A work around without javascript would be using two tables:
First one showing column X row and row total; the second one only shows the column variable total. For the second table, you'll use survey metadata / Finished / True as metric, and your column variable as breakout variable.
Be sure to min. the margins between the two tables, delete the title of the second table, min. header text and make it white (to hide it) in the second table, and make sure columns line up. They'll kinda look like one table in a not too ugly way, and produce the information you need.
Just like this table I did. It does not seem to add up because I am only taking a screenshot of the second half of my table:
image.png