I want to get the Operating Units in Asp Dropdown list from SSAS Cube.
The structure is:
I want all of the members in a result DataSet/DataTable then I'll be able to bind the DataTable to Asp DropDown.
My Desired Result set is like :
I've tried the following MDX:
select {} on 0,
[Product Hierarchy].[Operating Unit].members on 1
from
[Consolidated Sales];
The output I'm getting is:
I am unable to fill the result set in DataTable in asp.net, I've tried the following code:
//Lets store the connection string and MDX query to local variables
string strConn = txtConnStr.Text;
string strMDX = txtMDX.Text;
//create and open adomd connection with connection string
AdomdConnection conn = new AdomdConnection(strConn);
DataTable dt = new DataTable();
AdomdCommand cmd = new AdomdCommand();
cmd = conn.CreateCommand();
//cmd.Parameters.Add("DimProductRegion", "Bike");
cmd.CommandText = "select { } on columns, [Product Hierarchy].[Operating Unit].[Operating Unit] on rows from [Consolidated Sales]";
AdomdDataAdapter da = new AdomdDataAdapter(cmd);
da.Fill(dt);
DDL_Product.DataSource = dt;
DDL_Product.DataTextField = "ParameterCaption";
DDL_Product.DataValueField = "ParameterValue";
DDL_Product.DataBind();
Please Help me resolve this. I'm new to MDX