Showing posts with label meet. Show all posts
Showing posts with label meet. Show all posts

Saturday, February 25, 2012

AMO:Quesiton About the DataSourceView

Hi, friends, thank you very much to read my question as below:

I 'am using the AMO, and meet a question about the DataSourceView object.

My question is very simple:

After I added a column into a source table in the SQL Server, how to get the change into the DataSourceView object?

Background:

I have a cube in my OLAP Server, and I connect with it in my application with AMO. My task is to add a new measure, mapping to a new column I just added into the source table, just like this:

Dim meas As Microsoft.AnalysisServices.Measure

meas = Mainform.tDatabase.Cubes(0).MeasureGroups(0).Measures.Add()
meas.Source = CreateDataItem(Mainform.tDatabase.DataSourceViews(0), TableName, ColumnName)

But my problem is that the table schema in the DataSourceViews(0) doesn't include the column just added.

How could I update the DataSourceViews? I tried the Update() method, but that's is used to update the the OLAP server, not what I want to do. I want to update the DataSourceViews object itself refering to the SQL Server's table schema.

Thanks!

Have you added the column to your datatable that you use to populate your DSV ?
|||

sorry, I dont' catch your mean. I have added the column to the source table in the database of the sql server 2005. What is your mean of "MY Datatable use to populate my DSV"? Perhaps, you could teach me how to populate my DSV based on the datatable in the sql server 2005.

Thanks.

|||Hi,

Take a look at this If you scroll down to the part where it says "DataSourceView Objects", you will see that they are using SQL to populate a datatable to fill the datasourceview. This is very similar to what you will do, You've added the new column in the table in your database, now you've got to query that column, to add it to the datatable.

Hope that makes sense,

C

Friday, February 24, 2012

AMO Question - Distinct members in Cube

Hi,

How to filter members in a dimension.

To meet a requirement, I made a table as a Fact and a Dimension. In the said table, I have a column which is varchar and contains unique values always. They can be said as 'A' or 'B' or 'C'. For all records in the said table, any of these three values can be present. But they are not from any lookup table but come from a third party system.

Using the AMO object, I am listing all the values are members. But the problem I am facing is, I am getting all values as members. As per my requirement, I must list only distinct of them

I am setting the DimensionAttribute object's Usage property to Key, OrderBy to OrderBy.Name and Type to Regular. What other property need to be set to list only the unique values as members?

I request a quick response to this query. I am desperately looking for the reply to solve the problem.

Thanks

Sekhar PC

Sorry Sekhar.

But the description of your problem is not very clear. Can you try to describe what you are trying to acheve.

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Thank you for your reply.

In my cube, I have a fact table which has a column of varchar type. Assume that, the possible values are A,B,C,D.

While building the cube using the AMO and VB.Net, I am required to list them as members in the cube. Essentially, I am required to fetch the distinct values from that column and list as members.

How to that using AMO and VB.Net?

Thanks in advance

Sekhar

|||

You dont use AMO for retreiving data from Analysis Services. For that you use ADOMD.NET object model ( not the only option, but it might be easiest for you).

Here is some information on how to use ADOMD.NET

http://msdn2.microsoft.com/en-us/library/ms123483.aspx
http://msdn2.microsoft.com/en-us/library/ms123477.aspx

You can try and get a book on Analysis Services: Teo Lachev's "Applied Microsoft Analysis Services 2005.. " is good one you can use.

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

AMO Question - Distinct members in Cube

Hi,

How to filter members in a dimension.

To meet a requirement, I made a table as a Fact and a Dimension. In the said table, I have a column which is varchar and contains unique values always. They can be said as 'A' or 'B' or 'C'. For all records in the said table, any of these three values can be present. But they are not from any lookup table but come from a third party system.

Using the AMO object, I am listing all the values are members. But the problem I am facing is, I am getting all values as members. As per my requirement, I must list only distinct of them

I am setting the DimensionAttribute object's Usage property to Key, OrderBy to OrderBy.Name and Type to Regular. What other property need to be set to list only the unique values as members?

I request a quick response to this query. I am desperately looking for the reply to solve the problem.

Thanks

Sekhar PC

Sorry Sekhar.

But the description of your problem is not very clear. Can you try to describe what you are trying to acheve.

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Thank you for your reply.

In my cube, I have a fact table which has a column of varchar type. Assume that, the possible values are A,B,C,D.

While building the cube using the AMO and VB.Net, I am required to list them as members in the cube. Essentially, I am required to fetch the distinct values from that column and list as members.

How to that using AMO and VB.Net?

Thanks in advance

Sekhar

|||

You dont use AMO for retreiving data from Analysis Services. For that you use ADOMD.NET object model ( not the only option, but it might be easiest for you).

Here is some information on how to use ADOMD.NET

http://msdn2.microsoft.com/en-us/library/ms123483.aspx
http://msdn2.microsoft.com/en-us/library/ms123477.aspx

You can try and get a book on Analysis Services: Teo Lachev's "Applied Microsoft Analysis Services 2005.. " is good one you can use.

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.