Change to Dimension ID and Fact ID from Varchar to Int. Need to sort in Analysis Services

  • In an attempt to get something done quick I made a blunder and my Age dimesnion IDwas varchar along with the fact table.

    I managed to sort it out and they are now both int.

    However Im getting the following error message(s) for every fact table.

    Error1MeasureGroupAttribute [SEN].[COP Stage Pupil Business Measures].[Age].[DW Age ID]

    The key column #0 has data type 'WChar' different than the attribute's key column data type 'Integer'.00

    Im not sure how to sort this out. is there any way to get this reset?

    Ta

    Debbie

  • Have you refreshed your data source view so that it picks up the new schema?

  • Yes I have done all of that and the data source is reflecting the new data types

  • Strange as that would of been my first point to look at, as it seems to be the most logical.

    Have you tried using a calculated column using a cast operator to implicitly change the data types (shouldn't have to if the DSV is correct but might be worth a shot).

  • Looks like Ive got a lot more problems that that I currently have a very broken Project. T

  • You'll need to alter the datatype of the attribute

    Edit the dimension and go to properties of the offending attribute. KeyColumns --> DataType needs to be changed from WChar to Integer

    Mack

  • It already is an integer. The data source is fine. Do you mean on the cube its self?

  • Sorry for being unclear..... Edit the dimension of the cube and go to properties of the offending attribute. KeyColumns --> DataType needs to be changed from WChar to Integer

    The cube attribute stores the datatype as well - not sure just updating just the DSV is enough

    Mack

  • OK so...

    Im in the cube. I go into the tab dimension useage

    for the Age dimension the measure group column side is underlined in red

    The Key column has data type Wchar different that the attributes ID of Integer. To correct this issue edit the relationship or delete and recreate it.

    OK so I go in to try and delete and I cant see anything about the key column, Even when I go into advanced.

    I could try and create the relationship again in here but I'm guessing I'm still not in the right area that you are talking about

  • Ive deleted and added again in the Dimension useage tab. The red underline has gone. lets see what happens.

  • Thats sorted that issue out. Thankyou.

    Deleting ad readding got rid of this. Im now left with errors

    Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'fact_SEN_Fact_By_Calendar_Year', Column: 'DW_Age_ID', Value: '399863'. The attribute is 'DW Age ID'.

    And one of the age dimensions isnt working (Ive added another call for that one)

    At least thats one issue sorted through

    🙂

  • Sounds like you're not having the best day....

  • Im not having the best last 2 months

    Deadline is the beginning on next week. :crying:

  • Yup deleting and adding again to the dimension usage tab solved my issue.  I'm now able to save and process everything.

    So a little background.  I have a date formatting issue in excel.  The business users want the date dimension to be in the format mm/dd/yyyy.  But when it comes to sorting across multiple years, that is not possible.  Also excel 2013 for some reason is not taking my date dimension as a date but rather as a string.  Trust me I've looked at every excel setting to fix this but had no luck.  Maybe because our Analysis Server is 2008.  I don't know but the below resolved our issue.

    So now in order to allow proper sorting, I modified the date dimension to use a key that is a datetime datatype while it's name is char(10).  Also I set the order by settings to Key.

    This change resolved the sorting issue with mm/dd/yyyy because ordering is based on datetime and not char(10)

    Thank you everyone.

    Tung Dang
    Azure and SQL Server DBA Contractor / Consultant
    DataZip

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply