Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Feb 07, 2014 2:52 pm

Is possible insert formula table pivot ??
thanks

ict@sogedin.it
 
Posts: 63
Joined: Mon Jul 15, 2013 2:06 pm

Sat Feb 08, 2014 7:50 am

Hello,

Thanks for your inquiry.
Please kindly try the below method.
Code: Select all
pivotTable.CalculatedFields.Add(string name, string formula);


Best wishes,
Amy
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Wed Feb 12, 2014 8:57 am

Hello,

Have you tried the method? How did it work?
Thanks for your feedback.

Best wishes,
Amy
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Fri Feb 14, 2014 10:04 am

I'm sorry I confused the posts
I have two fields
pt.DataFields.Add (pt.PivotFields ["value"], "Performance Amount" SubtotalTypes.Sum);
pt.DataFields.Add (pt.PivotFields ["ValoreDrg"], "DRG Amount" SubtotalTypes.Sum);
I have to make the difference between the two as I do?
thanks

ict@sogedin.it
 
Posts: 63
Joined: Mon Jul 15, 2013 2:06 pm

Mon Feb 17, 2014 6:59 am

Hello,

They are two different dataFields. But they should be written:
Code: Select all
pt.DataFields.Add (pt.PivotFields ["value"], "Performance Amount", SubtotalTypes.Sum);
pt.DataFields.Add (pt.PivotFields ["ValoreDrg"], "DRG Amount", SubtotalTypes.Sum);


Best wishes,
Amy
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Sun Apr 06, 2014 10:46 am

yes, but I want another field with the difference between the two
pt.DataFields.Add (pt.PivotFields ["Difference"], Difference", [value] - [Valoredrg]);
is possible ??

ict@sogedin.it
 
Posts: 63
Joined: Mon Jul 15, 2013 2:06 pm

Mon Apr 07, 2014 9:51 am

Hello,

Sorry that at present our library doesn't support the function.

If there are any questions, welcome to get it back to us.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.XLS