Creating Tabular Models using AMO

Hi,
   I am trying to setup Tabular Models on SSAS using AMO referring to the materials available at Technet and the Codeplex AMO Tabular Tutorial. I have a few questions/issues
currently and was hoping I could get some help from here. The tool I am working with currently supports Multidimensional mode via AMO and I am trying to extend most of its features from the Multidimensional model. So, some of the questions might not exactly
fit into the Tabular model and if so, please do point them out.
RELATIONSHIPS: While creating relationships among tables,
would it suffice to create the relationship in the Data Source View Schema (as the tool currently does for the Multidimensional mode) or should we explicitly create relationships under the dimensions that we create to represent the table in Tabular mode? The
latter is the approach mentioned in the tutorial and I wanted to know if there is any difference between the relationships created using the 2 methods.
MEASURES: I am trying to create measures using Native
OLAP Measure objects in the Tabular model. I understand the shortcomings of this type of measures but I would still need to create them for basic aggregation functions like SUMMATION, COUNTS etc… I tried creating the measures using the same Measure Group that
was created to represent the table and used a ColumnBinding to the Measure’s source-column for the measure object’s source property but I get the following error:
Binding for VertiPaq measure MEASURE_NAME in measure group MEASURE_GROUP_NAME is invalid because it does not match any property binding of the fact dimension
TABLE_NAME
Am I missing anything here? Is there a better way of creating OLAP measures in TABULAR model without using the default Table dimensions that we create?
HIERARCHIES: I tried creating new Dimensions to hold
hierarchies for a table but when creating them, I get the error about MISSING ROWNUMBER attribute. Is this attribute mandatory for every dimension that is created?
To avoid this problem, I used the same dimension that was created to represent the table and tried adding inter-table attribute relationships to it but I get the following exception
message which I cannot figure out.
VertiPaq property ‘’ cannot have a name binding.
In general, can we create separate measure groups and dimensions, apart from the ones we use to represent the table, to store the custom measures and hierarchies? Is this a recommended
approach? This way, I am trying to keep things in parallel with the Multidimensional model that our tool currently supports but when I create such individual dimensions and measure groups, I get an error on the mismatch between the number of measure groups
and dimensions in the table.
   Please bear with the long list of questions. I could not find any help online for these and so am posting them all here.
Thank you.

RELATIONSHIPS: While creating relationships among tables,
would it suffice to create the relationship in the Data Source View Schema (as the tool currently does for the Multidimensional mode) or should we explicitly create relationships under the dimensions that we create to represent the table in Tabular mode? The
latter is the approach mentioned in the tutorial and I wanted to know if there is any difference between the relationships created using the 2 methods.
No - relationships in the DSV have no impact on the end model. You need to explicitly create relationships between your dimensions and measure groups for them to be picked up as relationships in your tabular model.
MEASURES: I am trying to create measures using Native OLAP
Measure objects in the Tabular model. I understand the shortcomings of this type of measures but I would still need to create them for basic aggregation functions like SUMMATION, COUNTS etc… I tried creating the measures using the same Measure Group that was
created to represent the table and used a ColumnBinding to the Measure’s source-column for the measure object’s source property but I get the following error:
Binding for VertiPaq measure MEASURE_NAME in measure group MEASURE_GROUP_NAME is invalid because it does not match any property binding of the fact dimension TABLE_NAME
Am I missing anything here? Is there a better way of creating OLAP measures in TABULAR model without using the default Table dimensions that we create?
There is no concept of native measures in a Tabular model. You need to create all your measures as "Calculated Measures" in AMO, but using the appropriate DAX expressions instead of MDX.
HIERARCHIES: I tried creating new Dimensions to hold hierarchies
for a table but when creating them, I get the error about MISSING ROWNUMBER attribute. Is this attribute mandatory for every dimension that is created?
To avoid this problem, I used the same dimension that was created to represent the table and tried adding inter-table attribute relationships to it but I get the following exception message
which I cannot figure out.
VertiPaq property ‘’ cannot have a name binding.
Yes, I believe every table needs the hidden RowNumber attribute. The
TableAddEmptyTable function in the tabular AMO sample on codeplex shows you how to create this.
In general, can we create separate measure groups and dimensions, apart from the ones we use to represent the table, to store the custom measures and hierarchies? Is this a recommended
approach? This way, I am trying to keep things in parallel with the Multidimensional model that our tool currently supports but when I create such individual dimensions and measure groups, I get an error on the mismatch between the number of measure groups
and dimensions in the table.
No you can't create any extra structures. Tabular projects only supports a subset of AMO. You need to follow the example on codeplex very closely and read all the code comments if you are making changes because it's very easy to break things.
My suggestion is to create an abstraction layer either using the TabularAMO library from codeplex as it is or creating your own library if you only need a subset of the functionality. This will mean that your core code is not too tightly bound to AMO. The
reason for this is that I would hope that MS will replace AMO with something better for Tabular models in a coming release and having a clear abstraction layer should make it easier to update to a new API.
http://darren.gosbell.com - please mark correct answers

Similar Messages

  • [Forum FAQ] How do I create calculated measure using AMO in SQL Server Analysis Services?

    Introduction
    In SQL Server Analysis Services (SSAS), you can create a calculated measure in SQL Server Data Tool (SSDT)/Boniness Integrated Development Studio (BIDS). Sometimes you may need to create calculated measure by using AMO in a C# or VB project.
    In this article, I will demonstrate so how to create calculated measure using AMO in SSAS?
    Prerequisites
    Before create calculated measure using AMO, you need to ensure that the following components were installed in your server.
    The multidimensional database AdventureWorks Multidimensional Model 2012
    A SQL Server with SSIS and SSAS installed
    The AMO libraries installed:
    X86 Package (SQL_AS_AMO.msi)
    X64 Package (SQL_AS_AMO.msi)
    Solution
    Here is the detail steps to create calculated measure using AMO in SSAS.
    Open SSDT and create a new SSIS project.
    Drag Script Task to the design surface.
    Click SSIS-> Variables to open the Variables window and add two variables that used to connect to the server and database.
    Create a connection to connect to SSAS server.
    Rename the connection name to ssas.
    Double click the Script Task to open Script Task Editor.
    Add Connection and Database variables to ReadWriteVariables textbox and then click Edit Script button.
    Add AMO reference in the Solution Explore window.
    Copy the script below and paste it into the script.
    Dim objServer As Server
    Dim objDatabase As Database
    Dim strDataBaseID As String
    Dim objCube As Cube
    Dim objMdxScript As MdxScript
    Dim objCommand As Command
    Dim strCommand As String
    objServer = New Server
    objServer.Connect("localhost")
    objDatabase = objServer.Databases("AdventureWorksDW2012Multidimensional-EE2")
    strDataBaseID = objDatabase.ID
    If objDatabase.Cubes.Count > 0 Then
    objCube = objDatabase.Cubes("Adventure Works")
    If objCube.MdxScripts.Count > 0 Then
    objMdxScript = objCube.MdxScripts("MdxScript")
    objMdxScript = objCube.MdxScripts(0)
    Else
    objCube.MdxScripts.Add("MdxScript", "MdxScript")
    objMdxScript = objCube.MdxScripts("MdxScript")
    End If
    objCommand = New Command
    strCommand = "CREATE MEMBER CURRENTCUBE.[Measures].[Multipy Measures By 3]"
    strCommand = strCommand & " AS [Measures].[Internet Sales Amount] * 3, "
    strCommand = strCommand & " VISIBLE = 1 ; "
    objCommand.Text = strCommand
    objMdxScript.Commands.Add(objCommand)
    objMdxScript.Update()
    objCube.Update()
    End If
    objServer.Disconnect()
    Then you can run this SSIS package to create the calculated measure.
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • Create data models using interactive reporting

    Hey guys,
    I was wondering how you create data models using interactive reporting. An simple example would be great? I would really appreciate if I could get an answer.
    Also, I wanted to understand a real world situation that you guys might have faced with creating data models, etc...thanks a ton :-)
    -- Adi

    Your question is not that much clear on what you are asking for.
    But for reference please have a look at the below doc which explain the Integration with IR and webanalysis what you require.
    IR and WebAnalysis with Essbase
    Thanks,
    ~KKT~

  • Creating tabular form using SQL query

    Hi,
    I need to create a tabular form using an SQL query so that multiple rows of a table are displayed on screen and are editable to the user.
    I have created this sort of form before using the Tabular Form wizard however for this form I need to enter SQL to produce it.
    The steps I take are:
    1. Create Page
    2. Page with Component
    3. Form
    4. Fow on a SQL query
    5. For the query I have: 'select * from depot_master_customer'
    However when I view the page, it just displays one blank field with the title '*' !!
    I am doing something completely wrong here? It seems like it should be a simple thing to do.
    Any help appreciated, this one is driving me mad.
    Thanks
    Simon

    Simon,
    You will need to manually create the tabular form and DML process. This is covered in detail in the How To document shown below:
    http://www.oracle.com/technology/products/database/htmldb/howtos/tabular_form.html
    Have you tried this yet?
    Good luck!
    Emilio.

  • How create tabular form using dynamic sql

    I have 50 tables and I need create application for support all these tables, I don't want to create 50 tubular regions.
    I want create list of tables; user pick one of them and I want generate dynamic tabular form for suppot.
    Is it possible?
    Thanks Mary

    Hi Mary,
    It is possible, but you would have to control everything manually. Have a look at: [http://apex.oracle.com/pls/otn/f?p=33642:252] - I've included instructions explaining how this has been created
    Andy

  • Dynamic security using Security table in SSAS Tabular model

    Hi, 
    Platform : SSAS Tabular model (VS 2010)
    I need to apply Dynamic security using Security table(manually created) in Tabular model, Need to apply filter for 2 tables. I am able to
    create roles in Tabular model using USERNAME() and LOOKUP() function it worked fine. But the problem is when i am trying to give full access for a particular column and limit the access in other column, it is not working properly.
    Please find below table and guide me where i am falling short. In the Security table wherever you find ALL it means full access.
    Security table
    Login Name
    Dim_Country
    Dim_Customer
    DOMAIN\User1
    ALL
    2
    User1 should see all countries but Only 2,4 Customers
    DOMAIN\User1
    ALL
    4
    DOMAIN\User2
    2
    ALL
    User2 should see all customers but Only 2,3 countries
    DOMAIN\User2
    3
    ALL
    DOMAIN\User3
    ALL
    ALL
    User3 should see all Customers and Countries
    DOMAIN\User4
    1
    3
    User4 should see 1 Country and 3 Customer
    ALL - means NO restriction
    Numeric values indicate the Dimension IDs
    Do let me know if further explanations required.
    Thanks,
    Sundar

    Hi Sundar,
    According to your description, you want to implement dynamic security using Security table in SQL Server Analysis Services Tabular model, right?
    It is very common to have data security implementation in BI projects either at databases or Cubes and sometimes this security implementation and maintenance goes out of control due to the dynamic flow of business information. Here are some links which describe
    dynamic security implementation at SSAS tabular model using an external security table, please see:
    http://bipassion.wordpress.com/2012/10/01/ssas-tabular-dynamic-security/
    http://www.bidn.com/blogs/ChrisSchmidt/ssas/4332/dynamic-security-in-tabular
    Regards,
    Charlie Liao
    TechNet Community Support

  • Cell Coloring using DAX in SSAS Tabular Model

    HI All, 
    I need to implement  background and foreground cell coloring in SSAS Tabular Model using DAX or any other feasible solution similar to what Cell Properties does with MDX which is supported by SSAS Cubes. 
    Request the gurus to help me with this problem.
    Thanks 
    ET

    Hi Et,
    As Marco said, this feature is not supported in current version. If you have any concern about this behavior, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that
    they can be, Microsoft might consider to add this feature in the following release after official confirmation.
    Thank you for your understanding.
    Regards,
    Charlie Liao
    TechNet Community Support

  • SSRS adhoc (2005/2008) - Need to create Report Model (.smdl file) for adhoc using Stored procedure

    Hi All,
    I need to create Report Models using stored procedures. But whenever I am going to create data sources for same, I am just getting tables and views to use. Please see the screenshot below:
    Is there any way out to create data source based on stored procedure? Please help.
    Thanks in Advance
    Regards
    Kumud

    Hi Kumud,
    As per my understanding, it is not support to create a Datasource View (DSV) using stored procedures.
    In a DataSource View, only views, tables or named queries can be used. We can use stored procedures in a query. No parameterized queries, parameterized stored procedures or parameterized UDFs can be used in a DSV named query. You can try to using below approach
    to achieve what you are require:
    To build views in our relational source and add the views to the datasource view to proceed with modelling.
    There is a similar issue, you can refer to it.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/22207c21-03c7-4e5a-bb67-0372f29220a3/sql-server-reporting-services-2008-creating-report-models-using-stored-procedures
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Time Intelligence DAX functions are not working in Tabular model

    Hello,
    I've implemented a simple tabular model using SQL Server 2012 SP1 SSDT with a date dimension that  has an active relationship with the date key in the fact table and has met the criteria for a date dimension to the best of my knowledge, i.e. no missing
    dates, etc.
    However, when I add a calculated measure in the VS project using any time intelligence function, i.e. =CALCULATE(SUM([NewPatientTotal]),TOTALYTD(DimDate[Date])), the calculated measure only returns the value of the current member, i.e. SUM(NewPatientTotal])
    without throwing an error.  This is happens for all time intelligence functions!
    Are there any best practices that I've missed? I've scoured the SSAS forums to no avail.
    Thanks,
    Ben
    Ben Lezin

    You probably forgot to use the "Mark as Date Table" on the DimDate table.
    Marco Russo (Blog,
    Twitter,
    LinkedIn) - sqlbi.com:
    Articles, Videos,
    Tools, Consultancy,
    Training
    Format with DAX Formatter and design with
    DAX Patterns. Learn
    Power Pivot and SSAS Tabular.

  • Tabular Model Partition

    Hi everyone
    Please help me,
    I am new to the tabular model 
    My table data size big having millions of records , i need to apply the Partition on my tables month wise or Year wise.
    I have search many blogs but i could not able to find the right solution,
    please help anyone i need step by step process. 
    please anyone share the documentation or link.
    its very helpful.
    Regards
    Sreeni

    Hi Sreeni,
    Partitions divide a table into logical parts, and each partition can then be processed (Refreshed) independent of other partitions. In this case, you should group by your partitions at month level, so we can directy process the "Jan-2014" partition to load
    data for business requirement.
    Besides, we can process the parition via SSIS package. Here are some articles for your reference, please see:
    Using Integration Services with tabular models:
    http://blogs.msdn.com/b/cathyk/archive/2011/09/08/using-integration-services-with-tabular-models.aspx
    SSIS Methods to Process SSAS Tabular Partitions:
    http://jessekraut.wordpress.com/2013/09/24/ssis-methods-to-process-ssas-tabular-partitions/
    Process Tabular Model using SSIS:
    http://www.bifeeds.com/2013/04/process-tabular-model-using-ssis.html
    Regards,
    Elvis Long
    TechNet Community Support

  • Create webservice model

    Hi all
    I am able to create a webservice model in webdynpro when my WSDL url starts with http.
    But now i want to create the model using same webservice running on https.
    The service is there running on https but i am not able to create model.
    I am not even getting any error while creating a model,
    the only thing is that i am not able to see my model if it is created.
    Is there any other procedure for creating such model in webdynpro
    Thanks,
    Archana

    Thanks Shridir for the reply,
    I created a new application and when i was trying to create a secured webservice model,I am not getting any error while creating it but i am not able to see that model any where in the explorer window and not even in my workspace.......
    No package nothing as if it has not been created  at all
    Archana

  • Report using Tabular Model and Measures based on Distinct Counts

    Hello,
    I am creating a report that should present something like this:
    YEAR-1 | MONTH-1 | MONTH-2 | MONTH-3... | YEAR | MONTH-1 | MONTH-2 | MONTH-3...
    My problem is that when designing the dataset to support this layout I drag the Year, Month and Distinct count Measure, but on the report when I want the value for the YEAR level I don't have it and I cannot sum the months value...
    What is the best aproach to solve this? Do I really have to go to advanced mode and customize my MDX or DAX? Can't basic users do something like this that seems so trivial and needed?
    Thank you
    Luis Simões

    Hi Luis,
    According to your description, you create a Reporting Services report using Analysis Service Tabular Model as the datasource, now what you want is sum the months value on year level, right?
    In your scenario, you can add the Month field to column group, add a parent group using Year Field and then add a Total on Month group. In this case, Reporting Services will sum the months value on Year level. I have tested it on my local environment, the
    screenshot below is for you reference.
    Reference:Lesson 6: Adding Grouping and Totals (Reporting Services)
    If this is not what you want, please describe your dataset structure, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • SSRS Parameters using SSAS Tabular model get cleared

    I have an SSRS report that uses data from a SSAS Tabular model.  In the query designer, from the calendar dimension I choose a "Date Inclusive" filter and make it a parameter. I also choose to add another filter using and Organisation Unit
    dimension and also make this a parameter. The report is written and deployed to a SharePoint 2013 library.
    Most of the time, the report runs as expected with the parameters cascading off each other as expected.  However, occasionally, parameters get cleared (either after changing a single value such as the Org Unit selection or sometime whilst the report
    is being rendered). Sometimes you cannot select a value from the available values - you need to navigate somewhere else and then start over.
    I changed the data source for the parameters to use SQL queries that return the same values as the MDX queries and the probably seems to have gone (time will tell)
    This report has a child (detail) report that has one extract parameter.  This parameter happens to have over 1,000 values.  With the change of the parent report, you are now able to get to the child report.  However, the child report seems
    to exhibit the same problem with the parameters being cleared - and with a much higher frequency.
    So, that leaves me wondering whether
    anyone else has experienced this ?
    is this an issue with SSRS 2012 and SSAS Tabular models (I have not seen this behaviour before and I have been using SSRS (since version 1) and SSAS Multi-dimensional (from when it was called "OLAP Services") ?

    We applied SQL Server 2012 Service Pack 2 to the SharePoint farm (the SP Admin needed to re-create the service applications) and the problem is fixed

  • Error about using a concatenated calculated column in a SSAS Tabular model

    Hi,
    in a my tabular model I've added in a dimension table a calculated column concatenating a code and a description. The code is used to create a relation between a fact table and this dimension table.
    When I try to use the tabular model inside Excel and select the concatenated column as a filter I've this error message:
    I've tried to recalculate some times the tabular database after the deployment of the model changes and I've tried to run a full process of the entire database but any results.
    Any suggests to me in order to solve this issue, please?
    Thanks

    Hi, I've solved. The concatenate formula was with "+" operator and not "&".
    But during the column creation I've any errors also if the model in SSDT was empty.
    Bye

  • Mining Models used in SQL Developer 3.0 and models created PL/SQL scripts

    Hi,
    Pardon my ignorance if some of my questions are very basic. I am just gaining understanding about building/using mining models.
    I installed sql developer and went thru some OBE exercises to build models ( classification models)
    While building workflows the exercise required to supply data for the pre built models ( the four models pre-created). The question is - is this exercise is about building models or using models ?
    How those pre-built models were created? Are these models are restricted in their usage. or are they generic models that they can be applied for solving similar problems?
    What type of models can be used in workflows?
    I am also seeing some smaples of pl/sql scripts used in creating some models. Is it correect to assume they are created using PL/SQL APIs ( DBMS_DATA_MINING, DBMS_DATA_MINING_TRANSFORM etc).
    What is the differrence between these two model building process ?
    Thanks

    Hi,
    The OBE exercises show you both how to build models and then to apply (Score) new data using the built models.
    A model is always built using some form of input data, so it is built specifically with that form of data in mind.
    It is not a generic model at all.
    When you apply a model you provide data in the same format as the original data.
    In the case of a Classification or Regression model, you are applying the model to generate a prediction on new data that conforms with the build data provided to the model.
    The online help provides details on all the models that are available.
    Data Miner uses the data mining pl/sql packages (package name DBMS_DATA_MINING) to create and test models.
    There are also sql data mining prediction functions as well.
    Thanks, Mark

Maybe you are looking for

  • How to import a doc file which is a file created by using the codings?

    Hai to all.... i'm now trying to import a word doc file which is created by using the CreateFile() method in Win32 Programming.... When i manually created a doc file and import that file using the PlaceFileInFrame method.... the contents of the doc f

  • X1 issues fixed (I hope)

    Moved to existing thread.

  • JAVA load already in database

    Hello too all, we've got a distributed system. SCS, CI running on Linux, db-instance on solaris with oracle. We need to reinstall SCS and CI, because of a hardware change. I've installed SCS and mounted /sapmnt/<SID>/global and /profiles folder on th

  • User defined attributes for use with personalization

    Hello, I have a stand alone region that works correctly and is able to be added to seeded pages via personalization. I would like to allow the personalization to define the value of a user defined attribute when the personalization is added to the pa

  • Is there any way to disable right click and drag and drop for photos on iweb?

    Re: protecting photos when using iweb as your web designer... Is there any way to disable right click and drag and drop for photos using iweb?  I have seen tutorials about creating a text box around each image - but is there a better way?