Help! PivotTotal Sorting

N

nigeaman

I am trying to sort a total within an Office Web Component 11 pivot table. I
can sort a Field from a FieldSet

e.g
fSetCustomer = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomer)
fSetCustomer.Fields("Customer").IsIncluded = True
fSetCustomer.Fields("Customer").SortDirection =
PivotFieldSortDirectionEnum.plSortDirectionAscending

but not a PivotTotal

objPTView.DataAxis.InsertTotal(objPTView.Totals("Order Value"))
objPTView.DataAxis.Totals("Order Value").NumberFormat = "Currency"
objPTView.DataAxis.Totals("Order Value").Field.SortDirection =
PivotFieldSortDirectionEnum.plSortDirectionDescending

Any help would be much appreciated.

Using SQL Server 2000 Analysis Services, .NET 2003
 
L

Luke Zhang [MSFT]

Hello,

Thank you for the posting. Regarding the issue, we are performing further
research and will update you as soon as possible.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi,

Currently I did not understand the behavior very much.
e.g.
I have a pivot table, the d1,d2,d3,d4, is the value totals(amount),

Year1, Year2
Data1 d1 d2
Data2 d3 d4

Based on my understand, if we want to sort the data in vector(d1,d3), we
are sorting Year1 column.
So what is the behavior that sort a total.

Can you show a screen shot and describe what is the goal you are going to
reach, so that we can do further efficient research.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi

Just wanted to write in to see if you have had an opportunity to review my
previous post.
If you could collect the information as I mentioned, we might be able to
perform further research on this to find the cause of the issue.


Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi Nigel,

For clarification, I think we'd better work on a sample, so that we can
expect the same data in our and your side.
So I connect the Footmart 2000 Sales cube, and add UnitSales in the
DataAxis(Totals) and Citry on RowAxis.

You may have a try.
'Foodmart, City on RowAxis and Unit Sales in Data Axis
Private Sub Command3_Click()
Dim f As PivotField
Set f = PivotTable1.ActiveView.FieldSets("Customers").Fields("City")
Set f.SortOn = PivotTable1.ActiveView.Totals("Unit Sales")
f.SortDirection = plSortDirectionDescending
End Sub

Or alternative using the command as below.

Private Sub Command1_Click()
Dim ttl As PivotTotal
Set ttl = PivotTable1.ActiveView.Totals("Unit Sales")
PivotTable1.Select ttl, ttl
PivotTable1.Commands(2031).Execute 'descending
PivotTable1.Select Nothing, Nothing
End Sub

You may have a try and let me know if that works for you.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi Nigel,

Just a followup on this post.
I am wondering if you have any questions or concerns about this issue.
If you need further assistance, please do not hesitate to let me know.


Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top