![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
So , the problem is 1) We have one dimension with 40000 members and select them using Hierarchize({[Accounts].Members}) 2) I use some code like in listing below to get values for each cell from ADOMD.Cellset. Result: Performance is very bad 1 minute for 4000 of rows and C# application takes 40 MB of memory without any additional operations only for reading (m_oAdoMDCellSet.get_Item(ref coords)). The same MDX in Visual Basic MDXSample application takes 30 sec for get and dislpay ALL data. What can I do in such situation ? ADOMD.Catalog m_oAdoMDCat; ADOMD.Cellset m_oAdoMDCellSet; m_oAdoMDCat = new ADOMD.CatalogClass(); m_oAdoMDCellSet = new ADOMD.Cellset(); ADOMD.Cell newcell; string m_constr ="""; string st = ""; st = st +"WITH member [Measures].Year as '[Calendar periods] .CurrentMember.Parent.Parent.Name',solve_order=2 "; st = st + "member [Measures].Month as '[Calendar periods] .CurrentMember.Name',solve_order=2 "; st = st + "member Measures.SubAccount as 'iif([Accounts] .CurrentMember.Level is [Sub Account],[Accounts].CurrentMember.Properties(\ "s_code\"),\"\")' "; st = st + "member Measures.ExpenseCode as 'iif([Accounts] .CurrentMember.Level is [Sub Account],[Accounts].CurrentMember.Properties(\ "s_expense_code\"),\"\")' "; st = st + "SELECT { {[Calendar periods].[2005].[Quarter 2].[May]} * {[Measures].Year,[Measures].Month,[Measures].[SubAccount],[Measures] .ExpenseCode,Measures.[Amount Actual]} } ON COLUMNS ,"; st = st + "{Hierarchize({[Accounts].Members}) } ON ROWS "; st = st + "FROM [Trial Balance] "; st = st + "WHERE ([Fiscal periods].[All Fiscal periods])"; m_oAdoMDCat.let_ActiveConnection(m_constr); m_oAdoMDCellSet.Open(st, m_oAdoMDCat.ActiveConnection); int cols = m_oAdoMDCellSet.Axes[0].Positions.Count; int rows = m_oAdoMDCellSet.Axes[1].Positions.Count; int dims = m_oAdoMDCellSet.Axes[1].DimensionCount; object[] coords = new object[2]; for (int i=0;i<rows;i++) { for(int j=0;j<dims;j++) { string str = m_oAdoMDCellSet.Axes[1].Positions[i].Members[j].Caption; } for (int m=0;m<cols;m++) { coords[0] = m; //column coords[1] = i; //row newcell = m_oAdoMDCellSet.get_Item(ref coords); } } m_oAdoMDCellSet.Close(); } |
#3
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |