SSAS dimensions hierarchies: A duplicate attribute key has been found when processing - ssas

I am completely new to SSAS an I am trying to deploy a simple cube with only one dimention comprised of multiples attributes. What I did already was to create a DSV from my data source and then I created a dimension from my fact table. It seams that no matter what happens, I get the following error message:
Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'dbo_Fact_Statistics', Column: 'Team', value: 'ANA'. The attribute is 'Team'.
This is my hierarchy: Id (SK) -> Player id -> Team -> Player Name -> Salary
I don't understand, obviously the problem is not that the value is null, like I've seen in other threads, telling me to set NullProcessing under KeyColumns to something else than automatic, but this is not the problem in this context.
Any help would be greatly appreciated.

Probably you have Team ANA listed under multiple Player Names and/or Salary values.
This is a really tricky area of SSAS. The quickest way forward is probably to install BIDS Helper and use the "Dimension Health Check" function:
http://bidshelper.codeplex.com/wikipage?title=Dimension%20Health%20Check&referringTitle=Documentation
It will show you all the issues in your data (not just the first one which you have discovered so far) and give you some info on how to proceed.
Personally I've gone off building attribute relationships due to the difficulty of debugging and fixing these issues. I tend to build dimensions now where every attribute relates directly to the key attribute. You never see these errors and performance seems very similar. You can still present the users with hierarchies.
If that is not an option for you, then you could try adding the columns for the higher-level attributes to the Key property of all the lower levels. Technically this will work but it is awkward to set up and maintain.

This approach solved my problem:
Instead of having the attributes following chained relationships, I simply leave the relationships as they were by default.
Player id (SK) -> Conference
Player id (SK) -> Division
Player id (SK) -> Team
Player id (SK) -> Player Name
Player id (SK) -> Salary

run this in sql find your douplicate for example ID... used it as my dimension key
Select id,count(*) as how_many
from [RC_Dailer_WH].[dbo].[RC_call_logs]
group by id
having count(*) > 1
(3647 row(s) affected) of which there are more than 50k records in my DB
removed duplicates then my cube processed proper

go for that dimension on which it is showing error.
and right click
go for view code
and search for the below line in that code:
ReportAndStop
delete that XML tag
and save
and reprocess it will works

Go to dimension for which it is showing Error. and give right click - go to view code -
CTRL+F - sarch for Connection - find
ReportAndStop
connection String.
Delete the above Command from the Code – and Save.
Process it again.
It will work.

Related

Roll up not working correctly when using custom key columns

I have a dimension that I flattened, the data looks like:
This is a simplification of the data, I actually have 7 "Detail" values that are the same for each PrimaryValue and 2 "SubDetail" values. Each SubValue has one blank (not a null, there are no nulls in the table) for each PrimaryValue.
I am trying to setup a hierarchy so the users see:
PrimaryValue
SubValue
The cube does not like the data and complains about duplicate keys so I changed the key columns and I got it to process but my hierarchy shows one PrimaryValue for each SubValue so It looks like this in the Browser:
ABC
this one is the blank value
ABC
A
ABC
Q
ABC
G
And so on. When I what I want is:
ABC
A
Q
G
XYZ
7
F
1E
I am new to cubes but I have tried everything I can think of and read about on the web. I think my issue is that I have multiple "Detail" and "SubDetail". I have the Hierarchy defined as:
PrimaryValue
SubValue
I setup the Attributes so PrimaryValue relates to SubValue and Detail1 and Detail2 I have SubValue relating to SubDetail1.
I have tried every KeyColumns combination I can think of and either the cube wont process due to duplicate key values, or it will process and I get the issue I am describing here or I get and error in the Browser "The key1 dimension attribute was not found"
I could not find anything on the web about this issue, I am probably wording it wrong. I have found a lot about setting up key columns but none address the extra detail fields in their examples or describe the rollup issues I am seeing.
This is a simple answer, I am surprised I could not find this error on the web. I had my attribute relationships backward. Should be most specific to most general but I had the most general (the one with the fewest unique values) to the most specific (the one with the most unique values). Surprised it worked at all!!
So in my example I should have had SubValue related to PrimaryValue.

Managing PerformancePoint Filters With Slowly Changing Dimensions

Just a bit of background info:
I have dimension table which uses SCD2 to track user changes in our company (team changes, job title changes etc) See example below:
I've built an Analysis Services Cube and created all the necessary hierarchy's for the dimensions and it works well when navigating and drilling down through the fact table.
The problem I have is with the filters on the PerformancePoint dashboard. As I'm using the User Dimension table with it's multiple instances of users it's showing duplicates up in the list. I can understand why as the surrogate ID is being referenced on the Dimension. But if I choose the first instance of the A-team I will see all their sales for a particular period and if I choose the second instance I will see all their sales for a different period.
What is the best way to handle this type of behavior? Ideally I'd like to see a distinct list of teams in alphabetical order and when I choose the team name it shows all of their data over time.
I've considered using MDX query filters but I'd like to see if there's anything I haven't thought about.
I realise this isn't an easy and quick question but any help would be appreciated!
The answer was simple after having a trawl through my User Dimension table on the Cube.
Under my user dimension I added 2 duplicate attributes to my attributes list ("Team Filter" is a copy of "Team", "User Filter" a copy of "User Name") these will be used only for filtering the dashboard.
Under the attribute properties for each duplicate I then set AttributeHierarchyOptimizedState to "Not Optimized", I also set their AttributeHierarchyVisible to false as I'd shown the two duplicate attributes in the hierarchy window in the middle.
Deploy your Cube to the server and go in to PerformancePoint. Create a new MDX Filter (this image shows the finished filter)
This is the code I used, it only shows dimension members which have a fact against them (reduces the list a considerable amount) and by using allmembers at the dimension it also gives me the option to show "All" at the top of the list.
Deploy the new filters and now you can see the distinct list of users and teams, works perfectly and selects every instance (regardless of the SCD2 row)

ATTASK/WORKFRONT - API - This "is not a top level object"

This sample will give me ALL the GUIDs for HOURS (Yes over 2000 you need to page to get the rest)
htps://YOURCOMAPNY.attask.com/attask/api/v4.0/hour/search?$$LIMIT=2000&fields=ID:*
Object=Hour
field=ID:* (wildcard for all)
If I wanted to do the same thing to SCANS (ScoreCard Answer)
htps://YOURCOMAPNY.attask.com/attask/api/v4.0/scans/search?$$LIMIT=2000&fields=ID:*
Object=scans (Scorecard Answer)
Field=ID:* (Wildcard All)
I get an error:
{"error":{"class":"java.lang.IllegalArgumentException","message":"SCANS is not a top level object and can't be requested directly in internal"}}
I Can do this to pull a ton of project information and I have to parse it all such as produced by this code.
htps://YOURCOMAPNY.attask.com/attask/api/v4.0/proj/search?fields=alignmentScoreCard:,alignmentValues:,alignmentValues:scoreCardQuestion:*
And if I click thru it I can find a ID for a scans and a scoreq and if I take that scans or scoreq and attempt to pull it using the field=ID or
htps://YOURCOMPANY.attask.com/attask/api/v4.0/scans/YOURGUIDHEREXXXXXXXXX/
This again tells me:
{"error":{"class":"java.lang.IllegalArgumentException","message":"SCANS is not a top level object and can't be requested directly in internal"}}
I can pull just about anything and get a list of ID's and then manually pull those items by ID but the scores/scorecard answers/scorecard questions (Even as the API seems to indicate that I can pull this like anything else does NOT allow me to do so?
Suggestions? I know its all associated with projectIDs and such I just want to get a list of them all and work with the ones that I want on a one - one basis without having to pull the PROJ and then rummage thru to locate all the ID's associated with it (If there are one or many) Is this possible?
Thank you!
I don't think there is any workaround for this..
you have to go via projects only..
I am also searching a method for this...
I had to update scorecard answers and I had to go via projects..

SSAS : Unoknow Members still shows on Report Slicer

I have created Dimension - Vendors,Distributors and Time
And I have Fact tables Purchase and Total Paid Amount.
I have also set below properties for Dimension :
UnknownMember : Hidden
and for the Key Column Property
NullProcess : Error
I have also done properly Attribute Relationship on the Cube. So that it is giving me proper result as below.
It is showing values without Unknown Members.
Now, On my report I have put the slicer for the Venders.
And it still shows Unknown as a member. I don't even have any null key in any table.
Anyone has any idea, how to get rid of this unknown member with Best Practices?
I am using SQL Server 2012 with Latest NU update. So that I can create Power View reports using connection on sharepoint site.
Thank you,

Implicit Fact division and Dimension Usage

I have a star schema with Implicit Fact division as shown in Figure 5 at http://www.information-management.com/infodirect/20020308/4858-1.html?pg=2.
My question is how do I set up the Dimension Usage? My first thought was to set up 3 Referenced Relationships (CustomerGroup to InvoiceItemFacts, GroupToCustomer to CustomerGroup, CustomerDimension to GroupToCustomer), but when I try this I get the message "A loop was found in the data source view at the 'dbo_CustomerGroup' table".
Update:
I have found that if I create a Regular Relationship between GroupToCustomer and InvoiceItemFacts (effectively by passing the CustomerGroup table because I already have the Customer Group Key) I can get some results. However, when I browse the cube and display the InvoiceItemFacts by Customer, the InvoiceItemFacts only display on the first Customer in the group.
GroupToCustomer looks to be a "Fact-less Fact Table", so you would create a measuregroup on that, doesn't need to be visible to the end users, then do a Many-Many join via that fact in the dimension usage tab.
It's a little complicated by the extra table in the way, but that should be the approach.