A way to configuring totals for a column that uses custom ids for choices

10 Views Asked by At

below is a sample of matrix question , you can see that questions and choices all have a unique id and display text. I want a column to show totals but since the answers will be choice id and not the text wondering how I could write a way to retrieve display text and use it to get a total.

{
 "logoPosition": "right",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "matrixdropdown",
     "name": "1_135_1699374621379_389602",
     "title": "scores?",
     "columns": [
      {
       "name": "1_135_1699374621379_280623",
       "title": "team 1",
       "cellType": "dropdown",
       **"totalType": "sum",
       "totalFormat": "{0}",
       "totalDisplayStyle": "decimal",**
       "choices": [
        {
         "value": "a",
         "text": "40"
        },
        {
         "value": "b",
         "text": "20"
        },
        {
         "value": "c",
         "text": "30"
        }
       ],
       "storeOthersAsComment": true
      },
      {
       "name": "1_135_1699374953774_19548",
       "title": "team 2"
      }
     ],
     "choices": [
      {
       "value": "a",
       "text": "10"
      },
      {
       "value": "b",
       "text": "20"
      },
      {
       "value": "c",
       "text": "30"
      }
     ],
     "rows": [
      {
       "value": "1_135_1699374621379_802729",
       "text": "match1"
      },
      {
       "value": "1_135_1699374621379_941923",
       "text": "match2"
      },
      {
       "value": "1_135_1699374996423_83949",
       "text": "match3"
      }
     ]
    }
   ]
  }
 ]
}

i am not getting the totals as the choices are stored as a,b,c

Please can you help.

don't want to be creating hidden columns just a way to get the display text for the choice.

if I change the choices to be same as display text, I can get totals. HEnce wondering if given the question name if I could grab the text value and use that to calculate the totals.

0

There are 0 best solutions below