title: Output in Json format using dataweave
body: <p>I'm trying to convert the field-value mapping from CSV to Json format,below code is my dataweave code for mapping the fields from CSV and converting it into Json format:</p>
  
  <pre><code>%dw 1.0    
  %output application/json    
  ---    
  {
  
  "volume":
  [       
      payload groupBy $.StartDate map ((val,cal) -&gt;
      {
          StartDate:val.StartDate[0],
  
          rows :
          [
              {
                  AccountID : val.AccountID,
                  ProductID : val.ProductID,
                  Value : val.Value
              }
          ]
      }
      )
  ]    
  }
  </code></pre>
  
  <p>Iam getting output as below :-</p>
  
  <pre><code>{
  
  "volume": [
  [
    {
      "StartDate": "8/1/2016",
      "AccountID": [
        "16482965",
        "16482966"
      ],
      "ProductID": [
        "12235398476-AR02",
        "12235398477-AR03"
      ],
      "Value": [
        "1720",
        "1722"
      ]
    },
    .
    .
    .
  </code></pre>
  
  <p>But i want my output to look like below :</p>
  
  <pre><code>  {
  
  "volume": [
  [
    {
      "StartDate": "8/1/2016",
      "AccountID":"16482965","ProductID":"12235398476-AR02","Value":"1720",
      "AccountID":"16482966","ProductID":"12235398477-AR03","Value": "1722"
     },
       .
       .
       .
  </code></pre>
  
  <p>Can anybody please here?</p>