referenced relationships sql server analysis Services, How can i create it - ssas

enter image description hereI'm beginner in SSAS, actually I work on SSAS Olap cube I have an issue which is I can not add customer fields to charge dimension or to charge fact (to be displayed on power bi )
Thank you in advance

The general answer is:
Add dimension to the cube
Open "Dimension Usage" tab
Click on a cell crossing Measure Group vs Dimension
Use "Referenced" type and select another dimension as a Reference
But please provide more details:
What have you tried before asking a question here?
Why it didn't help?
What are you trying to achieve (with simple example in Excel, plain text etc.)? Like Customer: A,B,C, Charge: X,Y,Z. Their relations. What is your expectation.

Related

SSAS Mesure Source Table

I'am new on SSAS cube and i want to find the source table name of a mesure .
I cheked on properties but find nothing;enter image description here
How can I do to find the table that provide this mesure with data please .
Thanks for help
Based on your screen shot:
Cash Register Discrepancy Amount is the measure you are looking for
Cash Register Discrepancy Amount Local is the underlying measure
Now, you need to look for the source of the underlying measure, i.e., Cash Register Discrepancy Amount Local
Using the Adventure Works sample, the Measure Internet Gross Profit uses 2 underlying measures Internet Sales Amount and Internet Total Product Cost.
So, now we will search of this measure, first in Calculation, then in the Cube Structure. We can see the measure under the "Internet Sales", we can now go to the Properties to find the underlying table and column.
Good luck

MDX Dimension Navigation

I am on an MDX adventure and I'm at a point where I need to ask some questions.
I have a very basic dimension named Car. The attributes which comprise Car are as follows-
-Manufacturer
-Make
-Color
-Year
My fact table contains a sales measure ([Measures].[Sales]). I would like to know , without explicitly defining a user hierarchy, how to sum the sales from
a specific group in this hierarchy
For example, I want to sum the sales of all red Trucks made in 2002. My attempt errors out-
sum([Cars].[Make].[Make].&[Truck]&[Red]&[2002], [Measures].[Sales])
How can I navigate the attribute hierarchy in this way? I will be browsing the cube in excel
Thanks
If you open an mdx query in SSMS and drag a member from one of your attribute hierarchies into the query pain you will see the full name.
You definitely cannot chain hierarchies like this ...].&[Truck]&[Red]&[2002]
Each full name will likely be similar to what MrHappyHead has detailed but usually the attribute name is repeated e.g. for Make:
[Cars].[Make].[Make].&[Truck]
MrHappyHead have wrapped it all in the Sum function but this is not required - just wrap the coordinates in braces and a tuple is then formed which will point to the required area of the cube:
(
[Cars].[Make].[Make].&[Truck],
[Cars].[Color].[Color].&[Red],
[Cars].[Year].[Year].&[2002],
[Measures].[sales]
)
note: square brackets are pretty standard in mdx.
Is it something like:
Sum(
Cars.make.&[truck],
Cars.color.&[red],
Cars.year.[2002],
Measures.sales
)

How can i Extract Dimention - Fact connection Data from cube?

is there away to extract cube connections between fact and Dimensions as they are defined in the dimension usage ?
in connection i mean the Dimension Table and key columns as well as Measure group name, Columns as they are defined in the dimention usage
i am aware of ssas DMV as well as analysis server Stored procedure project (codeplex) but couldn't find my answer there .
thank u
Will the BIDS Helper Printer Friendly Dimension Usage feature or Column Usage Reports feature accomplish what you want?
Were you just wanting a PDF for documentation? If you need the C# code so you can embed it in your own program let me know.

Access system tables in calculation

Is there a way to access system tables in a SSAS cube calcuation?
For example the following query can be executed on a SSAS cube to return a last processed date:
SELECT LAST_DATA_UPDATE FROM $System.MDSCHEMA_CUBES WHERE CUBE_NAME = 'Cube'
How would one access this information in a calculation?
Background: We were using ASSP before (a third party sproc) to get the last cube processed date. Recently, this sproc threw an exception on one of our cubes and caused SSAS to go down. Using the above line of MDX did not have this behavior. I would rather not have our cube depend on third party code so I am looking for a way to access LAST_DATA_UPDATE in a calc for a specific cube name.
I usually include a detached Dimension in my cubes e.g. ".Cube Information" which includes attributes like this. Other useful attributes could expose the currency of the data e.g. when did the last underlying ETL process complete, or the release/build of your cube.
I feed this "Cube Information" dimension from a SQL view which returns a single row with whatever data is needed - you could use your SELECT statement. It also needs to return a Key column with a fixed value e.g. 1.
By "detached" I mean the "Cube Information" dimension has no entries in the Cube Dimension Relationship tab.
In the cube Calculation script, I assign the DEFAULT_MEMBER property for that dimension to the fixed Key value from the SSAS view.
Any client tool can then access those Dimension attributes.

SQL OLAP Cube and dimension

In a windows Server 2008, using SQL server 2005, Visual Studio and SQL Server Analysis Services i created an OLAP Cube.
The scenario is a typical store with sell products, customer and agents.
The cube is made by a fact table tblVendite (sell data) and dimensions based on sql views.
NOTE: I tried embed the screenshot here but they will resized and will not clear so i posted them in a safe site to view it:
SCREENSHOT: stucture of the cube
FACT TABLE tblVendite (sell) > PK: CdArticolo (IDProduct)
DIMENSION Prodotti (produtcs)
DIMENSION Calendario (calendar)
DIMENSION Agenti (agents)
DIMENSION Clienti (customer)
Browsing the cube with basic filters as calendar, customer/agent, products, brand ... all work fine
Now i need to provide a new feature as:
Comparing the "top sell brand" of all company with the sell of each agent to see how he sell those brand
So i did a new table and the related view: vwMarcheOrd (top sell brand)
The table top sell brand is pre-populated by a sp and contain 1 record for each brand (CdMarca - Position - Description order by Position)
NOTE: from vwMarcheOrd i cant have direct link to the fact table because the PK is CdMarca and it's not present so i need to "bridge" the view Products by CdMarca and get the CdArticolo to link the fact table
Dimension and the attributes for Brand and Top Brand:
SCREENSHOT: cube dimension
BROWSE THE CUBE AND THE PROBLEM
Adding the dimension Brand(1) to the row fields the result is correct but if i add the Top Brand(2) is incorrect and many brand are missing (but they exist)
SCREENSHOT: browse Top Brand
So my questions are 2:
What i missing or wrong or misunderstand with the Top Brand Dimension ?
How i can display all records of Top Brand in the row fields even if the agent didnt sell any item of that brand (blank row) ?
p.s. i tried also make a dimension based only with vMarcheOrd and then create a Referenced Relationship with the Product table to bridge CdMarca > CdArticolo > Fact Table but the result are the same
Thanks in advance who can really help me to solve this problem that block me since many days
From what I understand, it looks like the top brand could change over time. This means that you would need to somehow track that over time. In my opnion, the easiest way to do that would be to add the TopBrandKey to the fact table and join the top brand dimension directly to the fact table. This way the time tracking is done for you in the fact table. As new records come in, you would look up the key for the top brand and add that to the fact table. I don't think the way you have it would work because the product which was sold would not have the brand which is the top brand (those are two different things).
ciao luka :)
it seems to me that you don't have the proper attribute relationship between the attributes on your cube.
I see you are using BIDS 2005, which I'm not very familiar with it (it would be easier to help on 2008), but what you have to do is set the relations between Prodoti -> Brand -> top brand
you can do that by those + signs on the attributes bellow the dimension name.