# GrapeCity.Documents.Excel.IPivotField.Ungroup

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_IPivotField_Ungroup_" data-uid="GrapeCity.Documents.Excel.IPivotField.Ungroup*">Ungroup Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_IPivotField_Ungroup_" data-uid="GrapeCity.Documents.Excel.IPivotField.Ungroup*"></a>
<h4 id="GrapeCity_Documents_Excel_IPivotField_Ungroup" data-uid="GrapeCity.Documents.Excel.IPivotField.Ungroup">Ungroup()</h4>
<div class="markdown level1 summary"><p>Removes grouping from the pivot field.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void Ungroup()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub Ungroup()</code></pre>
</div>
<h5 id="GrapeCity_Documents_Excel_IPivotField_Ungroup_examples">Examples</h5>
<pre><code class="lang-csharp">Workbook workbook = new Workbook();
workbook.Options.Data.AutomaticGroupDateTimeInPivotTable = false;
IWorksheet worksheet = workbook.Worksheets[0];
worksheet.Range["A1:C5"].Value = new object[,]
{
    { "Order Date", "Region", "Amount" },
    { new DateTime(2024, 1, 5), "East", 10 },
    { new DateTime(2024, 1, 18), "West", 20 },
    { new DateTime(2024, 2, 2), "East", 30 },
    { new DateTime(2024, 2, 25), "West", 40 }
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "PivotTable1");
IPivotField orderDateField = pivotTable.PivotFields["Order Date"];
orderDateField.Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
PivotFieldDateGroupOptions options = new PivotFieldDateGroupOptions
{
    GroupBy = PivotFieldDateGroupBy.Months
};
orderDateField.Group(options);
orderDateField.Ungroup();</code></pre>

</div>
