title: How to group multiple columns in one column using Google Apps Script?
body: <p>There are different type of data in case type 3 column like Out of box failure, damage, misdirected, rejected case, Not Applicable, Info Request, Please Specify. I want to group the data to two columns. One is Out of Box and another one is combination of other data. </p>
  
  <p>So far, when I execute the script, for each data, it is creating a column. Therefore, there are so many columns. But I want just two columns. Below is the chart for the current result. 
  <a href="https://i.stack.imgur.com/ghSQT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ghSQT.png" alt="enter image description here"></a></p>
  
  <pre><code>function createGraph() {
        var data = SpreadsheetApp.openById('');
        var sheet = data.getSheets()[0];
  
        //create chart 
        //if chart created, this will update the existing chart
        if (sheet.getCharts().length &gt; 0){
        var chart = sheet.getCharts()[0];
        chart = chart.modify()
        .removeRange(chart.getRanges()[0])
       //.addRange(sheet.getRange("Y1:Y501"))
        .addRange(sheet.getRange("P1:P42"))
        .setOption('useFirstColumnAsDomain', true)
        .setOption('treatLabelsAsText', true)
        .setOption('applyAggregateData',0)
        .setNumHeaders(1)
        .setPosition(5, 6, 5, 5)
        .setOption("title", "Chart")
        .build()
        sheet.updateChart(chart)
  
      }
      else{
  
        //create new chart
      var chart = sheet.newChart()
      .setChartType(Charts.ChartType.COLUMN)
      //.addRange(sheet.getRange("Y1:Y501"))
      .addRange(sheet.getRange("P1:P42"))
      .setOption('useFirstColumnAsDomain', true)
      .setOption('applyAggregateData',0)
      .setOption('treatLabelsAsText', true)
      .setNumHeaders(1)
      .setPosition(5, 6, 5, 5)
      .setOption("title", "Chart")
      .build()
      sheet.insertChart(chart)
  
      }
    }
  </code></pre>
  
  <p>I expect the output to show two columns. One is for Out of Box and another column is for the other data which is combination of damage, misdirected, rejected case, Not Applicable, Info Request, Please Specify.</p>