<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Documentation – Manage Pivot Table Value Fields in Aspose.Cells for Go via C&#43;&#43;</title>
    <link>https://docs.aspose.com/cells/go-cpp/manage-value-fields/</link>
    <description>Recent content in Manage Pivot Table Value Fields in Aspose.Cells for Go via C&#43;&#43; on Documentation</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    
	  <atom:link href="https://docs.aspose.com/cells/go-cpp/manage-value-fields/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Gocpp: Consolidation Function with Golang via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/consolidation-function/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/consolidation-function/</guid>
      <description>
        
        
        &lt;h2 id=&#34;consolidation-function&#34;&gt;&lt;strong&gt;Consolidation function&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Aspose.Cells can be used to apply a &lt;strong&gt;ConsolidationFunction&lt;/strong&gt; to data fields (or value fields) of a pivot table. In Microsoft Excel, you can right‑click the value field and then select the &lt;strong&gt;Value Field Settings&amp;hellip;&lt;/strong&gt; option and then select the tab &lt;strong&gt;Summarize Values By&lt;/strong&gt;. From there, you can select any ConsolidationFunction of your choice, such as Sum, Count, Average, Max, Min, Product, Distinct Count, etc.&lt;/p&gt;
&lt;p&gt;Aspose.Cells provides the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/consolidationfunction/&#34;&gt;&lt;strong&gt;ConsolidationFunction&lt;/strong&gt;&lt;/a&gt; enumeration to support the following consolidation functions.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ConsolidationFunction::Average&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::Count&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::CountNums&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::DistinctCount&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::Max&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::Min&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::Product&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::StdDev&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::StdDevp&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::Sum&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::Var&lt;/li&gt;
&lt;li&gt;ConsolidationFunction::Varp&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;applying-consolidationfunction-to-data-fields-of-pivot-table&#34;&gt;&lt;strong&gt;Applying ConsolidationFunction to Data Fields of Pivot Table&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;The following code applies the &lt;strong&gt;Average&lt;/strong&gt; consolidation function to the first data field (or value field) and the &lt;strong&gt;DistinctCount&lt;/strong&gt; consolidation function to the second data field (or value field).&lt;/p&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-ConsolidationFunction.go&#34;&gt;&lt;/script&gt;



&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;

DistinctCount consolidation function is supported by Microsoft Excel 2013 only.
&lt;/div&gt;

&lt;button class=&#34;floating-button&#34; id=&#34;openModalBtn&#34;&gt;AI Document Assistant&lt;/button&gt;

&lt;div class=&#34;modal&#34; id=&#34;modal&#34;&gt;
    &lt;button class=&#34;close-btn&#34; id=&#34;closeModalBtn&#34;&gt;Close&lt;/button&gt;
    &lt;iframe src=&#34;https://products.aspose.ai/cells/chat/document/go?source=docs&#34; frameborder=&#34;0&#34; width=&#34;100%&#34; height=&#34;100%&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;style&gt;
    .floating-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #007bff;
        color: white;
        border: none;
        padding: 15px 20px;
        border-radius: 50px;
        cursor: pointer;
        font-size: 16px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .modal {
        display: none;
        position: fixed;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        background-color: white;
        border: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        padding: 20px;
        box-sizing: border-box;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: #f44336;
        color: white;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
        font-size: 16px;
        border-radius: 3px;
    }
&lt;/style&gt;

&lt;script&gt;
    const openModalBtn = document.getElementById(&#39;openModalBtn&#39;);
    const closeModalBtn = document.getElementById(&#39;closeModalBtn&#39;);
    const modal = document.getElementById(&#39;modal&#39;);

    openModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;block&#39;;
    });

    closeModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;none&#39;;
    });

    window.addEventListener(&#39;click&#39;, function(event) {
        if (event.target === modal) {
            modal.style.display = &#39;none&#39;;
        }
    });
&lt;/script&gt;


      </description>
    </item>
    
    <item>
      <title>Gocpp: Add calculated field in Pivot Table with Golang via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/add-calculated-field-in-pivot-table/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/add-calculated-field-in-pivot-table/</guid>
      <description>
        
        
        &lt;h2 id=&#34;possible-usage-scenarios&#34;&gt;&lt;strong&gt;Possible Usage Scenarios&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;When you create a pivot table based on known data, you may find that the data in it is not what you want. The data you need is a combination of the original data. For example, you may need to add, subtract, multiply, or divide the original data before obtaining the desired results. In such cases, you need to create a calculated field and set the corresponding formula for the calculation, then perform some statistical and other operations on the calculated field.&lt;/p&gt;
&lt;h2 id=&#34;add-calculated-field-in-pivot-table-in-excel&#34;&gt;&lt;strong&gt;Add calculated field in Pivot Table in Excel&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Insert a calculated field in a PivotTable in Excel, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the PivotTable that you want to add a calculated field to.&lt;/li&gt;
&lt;li&gt;Go to the PivotTable Analyze tab on the ribbon.&lt;/li&gt;
&lt;li&gt;Click on &amp;ldquo;Fields, Items, &amp;amp; Sets&amp;rdquo; and then select &amp;ldquo;Calculated Field&amp;rdquo; from the drop-down menu.&lt;/li&gt;
&lt;li&gt;In the &amp;ldquo;Name&amp;rdquo; field, enter a name for the calculated field.&lt;/li&gt;
&lt;li&gt;In the &amp;ldquo;Formula&amp;rdquo; field, enter the formula for the calculation you want to perform using the appropriate PivotTable field names and mathematical operators. 
&lt;br&gt;
&lt;img src=&#34;1.png&#34; width=80% /&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt; to create the calculated field.&lt;/li&gt;
&lt;li&gt;The new calculated field will appear in the PivotTable Field List under the Values section.&lt;/li&gt;
&lt;li&gt;Drag the calculated field to the Values section of the PivotTable to display the calculated values.
&lt;br&gt;
&lt;img src=&#34;2.png&#34; width=80% /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;add-calculated-field-in-pivot-table-using-c&#34;&gt;&lt;strong&gt;Add calculated field in Pivot Table Using C++&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Add a calculated field to an Excel file using Aspose.Cells. Please see the following sample code. After executing the example code, a pivot table with a calculated field is added to the worksheet.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the original data and create a pivot table.&lt;/li&gt;
&lt;li&gt;Create the calculated field according to the existing PivotField in the pivot table.&lt;/li&gt;
&lt;li&gt;Add the calculated field to the data area.&lt;/li&gt;
&lt;li&gt;Finally, it saves the workbook in the &lt;a href=&#34;out.xlsx&#34;&gt;output XLSX&lt;/a&gt; format.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;sample-code&#34;&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;/h2&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-AddCalculatedFieldInPivotTable.go&#34;&gt;&lt;/script&gt;


      </description>
    </item>
    
    <item>
      <title>Gocpp: Working with Data Display Formats of DataField in Pivot Table with Golang via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/working-with-data-display-formats-of-datafield-in-pivot-table/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/working-with-data-display-formats-of-datafield-in-pivot-table/</guid>
      <description>
        
        
        

&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;

Aspose.Cells supports all the data display formats of DataField.
&lt;/div&gt;

&lt;h2 id=&#34;rank-smallest-to-largest-and-rank-largest-to-smallest-display-format-options&#34;&gt;&lt;strong&gt;&amp;ldquo;Rank Smallest to Largest&amp;rdquo; and &amp;ldquo;Rank Largest to Smallest&amp;rdquo; Display Format Options&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Aspose.Cells provides the ability to set the display format option for pivot fields. For this, the API provides the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/pivotshowvaluessetting/getcalculationtype/&#34;&gt;&lt;strong&gt;PivotField.GetCalculationType()&lt;/strong&gt;&lt;/a&gt; property. To rank largest to smallest, you may set the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/pivotshowvaluessetting/getcalculationtype/&#34;&gt;&lt;strong&gt;PivotField.GetCalculationType()&lt;/strong&gt;&lt;/a&gt; property to &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/pivotfielddatadisplayformat/&#34;&gt;&lt;strong&gt;PivotFieldDataDisplayFormat.RankLargestToSmallest&lt;/strong&gt;&lt;/a&gt;. The following code snippet demonstrates setting the display format options.&lt;/p&gt;
&lt;p&gt;Sample source and output files can be downloaded here for testing the sample code:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;101089332.xlsx&#34;&gt;Source Excel File&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;101089333.xlsx&#34;&gt;Output Excel File&lt;/a&gt;&lt;/p&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-WorkingWithDataDisplayFormatsOfDatafieldInPivotTable.go&#34;&gt;&lt;/script&gt;

&lt;button class=&#34;floating-button&#34; id=&#34;openModalBtn&#34;&gt;AI Document Assistant&lt;/button&gt;

&lt;div class=&#34;modal&#34; id=&#34;modal&#34;&gt;
    &lt;button class=&#34;close-btn&#34; id=&#34;closeModalBtn&#34;&gt;Close&lt;/button&gt;
    &lt;iframe src=&#34;https://products.aspose.ai/cells/chat/document/go?source=docs&#34; frameborder=&#34;0&#34; width=&#34;100%&#34; height=&#34;100%&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;style&gt;
    .floating-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #007bff;
        color: white;
        border: none;
        padding: 15px 20px;
        border-radius: 50px;
        cursor: pointer;
        font-size: 16px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .modal {
        display: none;
        position: fixed;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        background-color: white;
        border: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        padding: 20px;
        box-sizing: border-box;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: #f44336;
        color: white;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
        font-size: 16px;
        border-radius: 3px;
    }
&lt;/style&gt;

&lt;script&gt;
    const openModalBtn = document.getElementById(&#39;openModalBtn&#39;);
    const closeModalBtn = document.getElementById(&#39;closeModalBtn&#39;);
    const modal = document.getElementById(&#39;modal&#39;);

    openModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;block&#39;;
    });

    closeModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;none&#39;;
    });

    window.addEventListener(&#39;click&#39;, function(event) {
        if (event.target === modal) {
            modal.style.display = &#39;none&#39;;
        }
    });
&lt;/script&gt;


      </description>
    </item>
    
  </channel>
</rss>
