I need to show Top 10 results for a particular column.
Lets say need to display only top 10 customers having maximum internet sales for a product. How can I achieve such functionality using xamPivotGrid. I understand that I might have to change MDX query that is run. (Or is there another way to do this?)
Hi Plamen,
I did change the statement and my statement does get executed. While the query runs fine and binds to xamPivotGrid fine, the problem is the state of the PivotGrid expand, collapse for the hierarchical data does not update properly.
Can you tell me how to update that properly?
I have been trying to Add Column or Row for the DataSource though the code. I get "Invalid cross-thread access." exception.
Here's the code snippet:
IHierarchy copied = new Infragistics.Olap.Data.Xmla.SqlAnalysisServices2008.Hierarchy( "New One", "[Customer].[Billto Customer Hierarchy].[Billto SNP Ultimate Client NM]", "New One", "New One", "[Customer].[Billto Customer Hierarchy].[Billto SNP Ultimate Client NM]", "[Customer].[Billto Customer Hierarchy].[Billto SNP Ultimate Client NM]", new Dimension("Billto Customer", "[Customer].[Billto Customer Hierarchy]", "[Billto Customer Hierarchy]", ""), "", HierarchyOrigin.UserDefined); IFilterViewModel vm = ds.CreateFilterViewModel(copied); ds.Columns.Add(vm)
Is it possible to do something Like what I am trying to do. Basically I am thinking to Filter in the DataSource. But right now just trying to add a column or row. Let me know what am I doing wrong here.
Yes, I had reached that point before. My problem is actually changing the MDX. Given an MDX query how can I dynamically generate another query with TopCount. I guess that would require lot of work and also mastery over MDX. This might also involve parsing the MDX query and dynamically changing it. Is there a simpler solution?
Hello,
You may need something like the query described in this post.
Currently we don’t support that functionality. However you can get access to the Execute statement passed to the XMLA service:
With the latest service release we provide XmlaDataSource.InitXmlaMethod event. When you are listening for this event you are able to:
1. Track all Discover queries passed against XMLA service – it means that in the event handler you have access to properties and restrictions included into the SOAP body when Discover is posted.
2. Track all Execute queries – you have access to the statement which we generate and execute against XMLA service.
Have a look at this sample:
private void XmlaDataSource_InitXmlaMethod(object sender, InitXmlaMethodEventArgs e)
{
XmlaSoapMethodExecute executeMethod = e.SoapMethod as XmlaSoapMethodExecute;
if (executeMethod != null)
string statement = executeMethod.Statement;
}
The statement can be modified and the modified version is the one that we will pass to XMLA service. Hopefully we can process properly the result returned in response of the modified statement.
Best regards.
Plamen.
I spoke with our engineers about this. Apparantly a query such as 'Select Top 5' cannot be run against Pivot Grid records. You would need to query the underlying data source for that.
Thank you for your patience on my response.
Sam