.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

ConvertToUnknown for Dimension Attributes

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :Sql Server


I have a dimension table:



Now, in AS Vendor dimension, I drag and drop "AgentName" attribute from tblAgent. This works fine. However, what AS does now, is that it basicly tries to inner join these two tables. So if there is no Agent for Vendor, it doesn't load that Vendor at all. How can I force it to conver such to unknown?

View Complete Post

More Related Resource Links

MDX query to filter on specific dimension attributes

Ok, trying to figure out how to filter on specific dimension attributes. Are there any suggestions? I have a measure that needs to be filtered by a dimension that has numerous attributes (20 attributes in total) but I only want to show that measure against 10 of the attributes and once I get that result I need filter that result set against my time dimension (which this part I have figure out)   This is what I have so far: With member [calculated_measure_name] as ( [measures].[count_of_people], { [dimelgiblestatus].[elgible].[elgible1], [dimelgiblestatus].[elgible].[elgible2], [dimelgiblestatus].[elgible].[elgible3], [dimelgiblestatus].[elgible].[elgible4], [dimelgiblestatus].[elgible].[elgible5], [dimelgiblestatus].[elgible].[elgible6], }   )   Select [calculated_measure_name] on columns, [date].[fsicalyear].&[2008], [date].[fsicalyear].&[2009], [date].[fsicalyear].&[2010], [date].[fsicalyear].&[2011] on rows from mycube   When I run it, it gets no errors but in the result set for the numbers I get "#error"; do I need to basically create a subcube in order to get the result like I would like? If so how would I start doing that?   ThanksNetwork Analyst

SSAS 2K5 - Name of the dimension included in attributes

Hi I have a fact table with 2 field using the same dimension table. So, in SSAS 2005, The dimension is added (Lets say dimXYZ). So the dimYXY is used for 2 field in my fact table. When I go in my "dimension usage" tab ... i'm adding the 2 dimension that are bind to 1 physical dimension wich is dimXYZ. So I rename (in the dimension usage tab) the dimension freshly added. ("Dimension AB" and "Dimension CD"). But when I browse the cube, the attributes are displayed like Dimension AB.NameOfAttributes and Dimension CD.NameOfAttributes) Is there a way to hide the name of the dimension in the attributes ? Thanks * Sorry for the bad english ... I speak french ;-)--------------------- Richard Martin

Duplicate key attributes with SCD2 dimension

I have a dimension table populated according to the SCD2 type, and have the following data (example data)   Surrogate Key Business Key EmployeeName Location SCD_StartTime SCD_EndTime 1 100 John Smith Boston 2001-12-31 NULL 2 101 Jane Doe Boston 2001-12-31 2004-09-30 3 101 Jane Doe New York 2004-09-30 NULL   In other words, in September 2004, Jane Doe moved from Boston to New York. In my dimension, I have created the following hierarchy: Location -> Employee (business key) -> Surrogate Key What I would like to achieve is the following structure when I browse the dimension on this hierarchy: - Location ---- Boston ------- John Smith ------- Jane Doe ---- New York ------- Jane Doe Instead of this, I get the error that a duplicate attribute key has been found on the field "Employee". I understand the error because in the hierarchy, Jane Doe falls under Boston and New York, and SSAS is not able to put them under one of them. But since Jane has existed in both locations, I would like to have her appear under both locations. How can I accomplish this? Thanks! -

Sorting the list of attributes (not members) of a dimension


Hi there,

Any solution with SSAS 2008 R2 for that problem?


"It looks very simple, but I cannot find how to order the list of attributes in a dimension. Let's say I have a dimension Item with two attributes:

- Code
- Description

and I want the Description to appear first. By default it's using the alphabetical ordering but can I change that ?"

It works fine with measures. In BIDS, CubeDesigner, there is are up und down buttons in order to move measures up or down. In the attribute pane, these buttons are inactive.

any help?


Displaying measure names on rows under the dimension attributes in SSRS report.


I'm very new to Reporting and this is my first assignment. I have to create a report out of Cube. I did pulled out the necessary Dimensions and Measures in the data set. However, I do have a problem generating the structure of the report. I have two dimensions and two measures. DimRegionName, DimDate, Measures.NewCustomers and Measures.RevisitMembers. The Year out of DimDate should be in columns and RegionName on Rows. On the top, the requirement is to display the names of the measures in rows under every RegionName and their values in the data field. Something as below - I did try to produce this using Matrix report but not sure how to display the measures on rows under the RegionName.  


                                 Year 2010        Year 2009

Bay Area

  New Customers              100                  150

  Revisit Members             50                     30

South Ca

ConvertToUnknown with referenced dimension?




I have a fact table with field ItemNo.
This links to Item dimension.
Sometimes, this field is empty. I have enabled CovertToUnknown for this measure group and KeyNotFound. This puts such entries under Unknown Item.

All that is good.

However, now I want to add another dimension link. Dimension Responsible is linked to fact table through reference dimension Item. Fact -> Item -> Responsible.

However, as soon as I do this, AS does an inner join to table Item when loading fact table. And as such, it does not pick up any records where ItemNo is empty.

Why does it do that and how do I keep ConvertToUnknown working?

Parent-Child Dimension - getting parent attributes


I have a parent-child dimension for Clients and Client Groups.  I am able to query the levels properly, however I am wondering how to properly filter these when using SSMS query browser, or Excel.  For example, there is a client code for both the client and client group.  I am able to filter based on the client code for the client, but the only attribute I see for the parent is Client Name.  I see the client code in the member properties of the group, but am unable to use these when browsing.  It would be nice to be able to filter the client group on the same attributes that I can filter the client on. 

Any assitance would be appreciated!  Thanks.

Prefixes on column headings of date attributes using shared dimension


When reusing a date dimension multiple times as in the Adventure Works cube, the attribute names are prefixed with the cube dimension name in the selector screen. However, when they are brought into the query, the prefix is dropped. So "Delivery Date.Date" becomes just "Date". This is also the case in Excel 2007 which can be confusing for users. Any way ar ound this?



Custom Attributes + Reflection


I recently started messing around with custom attributes and reflection. In my code below GetCustomAttributes never return a list (it should return atleast one):

Am i defining the custom attrib wrong?

public class GOrder:IOrder
        public string CertProductIDString { get; set; }

        public string GetRESTParams()
            string data = string.Empty;
                System.Reflection.MemberInfo inf = this.GetType();
                object[] attributes;
                attributes =  inf.GetCustomAttributes(typeof(RESTParamAttrib), true);
                foreach (Object attribute in attributes)
                    RESTParamAttrib attrib = (RESTParamAttrib)attribute;
                    data = data + string.Format("\nData: {0}", attrib.Param);

            catch (Exception ex)

                throw ex;

            return data;

    public class RESTParamAttrib:System.Attribute
        public RESTParamAttrib (string param)
            Param = param;

        public string

Basic Instincts: Designing With Custom Attributes


One of the most powerful aspects of the Microsoft® . NET Framework is its support for attributes. Attribute-based programming is extremely powerful because it adds a declarative dimension to designing and writing software.

Ted Pattison

MSDN Magazine May 2005

C++ Attributes: Make COM Programming a Breeze with New Feature in Visual Studio .NET


C++ attributes in Visual Studio .NET are used to generate C++ code through attribute providers. Attribute providers generate code for COM classes, and the code is injected by the C++ compiler at compile time. This has the effect of reducing the amount of code that you need to write. In addition, with C++ attributes you no longer need to maintain separate IDL and RGS files, which makes project management simpler. This article explains C++ attributes, the process used by the attribute provider to generate code, and the code that is automatically generated. It also covers how attributes affect the registration process, how attributes can be used to generate code module entry points, and how connection points can be implemented using C++ attributes. Also explained is how these features contribute to the Unified Event Model for the .NET platform.

Richard Grimes

MSDN Magazine April 2001

Which ComponentModel.DataAnnotations attributes are used in the Dynamic Data metadata classes?


This namespace contains a lot of attributes for use in, I'm sure, many different applications. I'm curious to know which subset of the attributes in this namespace can be and are used in the Dynamic Data proxy class system, where the entity class is given an attribute that specifies a metadata type. That type contains properties with the same names as properties in the entity class, and the metadata provider builds MetaColumns using attributes on properties in these 'buddy' (proxy') classes.

So far my list includes, from System.ComponentModel.DataAnnotations:

Required, Range, DisplayFormat, StringLength, UIHint, DataType, Regular Expression, Display Column, Editable, and CustomValidation.

And from System.ComponentModel:

DisplayName, Description, and DefaultValue.

Am I missing any?

This was originally asked by myself on StackOverflow at: http://stackoverflow.com/questions/3537356/which-componentmodel-dataannotations-attributes-are-used-in-the-dynamic-data-meta

Changing folder name loses Person attributes


I have a custom folder content type. These folders have several attributes including text fields, choice, dates, and person lookups from AD. When I change the folder name, the folder will keep its date, choice and text box attributes, but lose the person attributes. If I change it back to its old name then it regains the person attributes. The ID is stays the same. One of the person fields is a required field, but that it still saves as an empty field. If anyone has a work around or even a suggestion as to what might be causing this it would help a lot.

Html.RenderPartial appears to be stripping Model of custom attributes



I have implemented a custom ModelMetadataProvider so that I can decorate my view models with some custom attributes and everything was working fine until I made use of a Partial View.

The following code in my view works fine: -

<%: Html.DisplayFor(x => x.Results) %>

Results is a List which renders a custom display template and is also decorated with a custom attribute.  Using breakpoints, after the above line and prior to the code within the custom display template, the overridden CreateMetadata method in my custom ModelMetadataProvider is invoked.  If I look at the attributes collection parameter I can see that it does contain my custom attribute thus everything working as expected.

However, if I replace the above with the following line of code in my view then it breaks: -

<% Html.RenderPartial("ApplicationSearchResults", Model.Results, new ViewDataDictionary()); %>

All the Partial View contains is: -

<%: Html.DisplayFor(x => x) %>

Again using breakpoints, after the above line and prior to the code within the custom display template, the overridden CreateMetadata method in my custom ModelMetadataProvider is invoked.  But this time if I look at the attributes collection parameter my custom attribute is not there.

Any idea

Cannot set custom attributes on mobile controls in this page



I am beginner at mobile Pages with ASP.NET. And i want to make an application with contains  a few TextBox that have different size.

it's my sample code here:

<%@Page Inherits= "System.Web.UI.MobileControls.MobilePage" Language= "C# " %>
<%@ Register TagPrefix= "Mobile" Namespace= "System.Web.UI.MobileControls " Assembly= "System.Web.Mobile" %>
<Mobile:Form runat="server" id="form1" Paginate="true" >
<Mobile:Panel Paginate="True" runat=&

XmlSerializer - how to define class to not generate attributes in root element?

Hi! I have simple class that I serialize to xml file: <?xml version="1.0" encoding="utf-8"?> <MyRootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Area="East">   <Products>     <SalesProduct Taxable="true">       <Name>Sofa</Name>     </SalesProduct>     <Product>       <Name>Television</Name>     </Product>   </Products> </MyRootElement> I don`t want have in xml file attributes xmlns:xsi and xmlns:xsd. How can I define class to not have these two attributes in xml file? I tried use XmlRoot attribute but there is no control for these two attributes. They are always generated. Regards

Time Dimension Enhancement with Business intelligence Issue

Hi all, I want to add a year over year growth using the BI wizard (Time diemsion enhancement) but when I try to add this enhancement via the wizard then this last one has the button next disabled with a waning that says   A time dimension is required to enable this functionality. Ensure that you have a dimension of type Time, that contains at least one hierarchy with a level flagged as a time period. Inspite of the fact that I added that time dimsension with one hierarchy Time hierarchy Calendar Year Calendar Semester Calendar Quarter Time Key(With namecolumn defined as a named calculation that repsents the day with this format  yyyy, dd mm ) Me personaly I have a doubt about the last condition of the warning (with a level flagged as a time period) but I dont know exactly 1. If my doubt is right 2. What shoud I do to enhance the cube in this context using the time dimension enhancement The complexity resides in the simplicity
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend