Hi All,
how we get distinct value from two set.
for example-
i have cuts id in my set 1
101
102
in set 2 i have
102
when i see the count it should be show me count=1 because 102 exists in two sets.
Regards,
Manish
Hi All,
how we get distinct value from two set.
for example-
i have cuts id in my set 1
101
102
in set 2 i have
102
when i see the count it should be show me count=1 because 102 exists in two sets.
Regards,
Manish
Hi All,
WITH
MEMBER [Measures].[Metric] AS Round(sum(({[Year].[Year].&[2015]}),[Measures].[PurchaseSum]),2)
SET CustYear as exists([DIMCustomer].[Level 02].allmembers,({[Year].[Year].&[2015]}),"sales")
SET [BusinessSet] AS { filter((
EXISTS(CustYear, [DIMCustomer].[HierarchyCategory].&[UnitHierarchy],"sales")
),([Measures].[Metric] or [Measures].[Metric]=0) )}
SET [SellerFilterCustomerID] AS EXISTS([DIMSeller].[CustId].ALLMEMBERS,{[DIMSeller].[CustId].[All]}, "sales")
SET [SellerFilterCustomerType] AS EXISTS([DIMSeller].[CustId].ALLMEMBERS,[DIMSeller].[CustomerType].[All])
SET [SellerFilterCompanyName] AS EXISTS([DIMSeller].[CustId].ALLMEMBERS,{[DIMSeller].[Name].[All]}, "sales")
SET [SellerFilterCompanyLoc] AS EXISTS([DIMSeller].[CustId].ALLMEMBERS,[DIMSeller].[Organization].[All])
SET [FinalSellerFilter] as (intersect(intersect(intersect([SellerFilterCustomerID],[SellerFilterCustomerType]),[SellerFilterCompanyName]),[SellerFilterCompanyLoc]))
SET Name AS {[DIMCustomer].[Name].[All]}
SET Code AS {[DIMCustomer].[Code].[All]}
SET CustType AS {[DIMCustomer].[CustomerType].[All]}
SET OrgLoc AS {[DIMCustomer].[Organization].[All]}
SET CustFilters AS (Name,Code,CustType,OrgLoc)
SET ICP as {{[DimProduct].[ICP].[All]}}
SET ProdICP as (ICP)
SET CrYear as {[Year].[Year].&[2015]}
SET Others AS (CrYear,ProdICP)
SET [SalesSet] AS exists([BusinessSet],[FinalSellerFilter],"sales")
SET FINALSET as exists([SalesSet],CustFilters,"sales" )
SET Geo as exists([DIMCustomer].[ParentPostalNumber].[ParentPostalNumber],({[Year].[Year].&[2015]}),"sales")
SET [FIPS] AS Except(EXISTS(Geo,[SalesSet], "sales"),{[DIMCustomer].[ParentPostalNumber].&[0],[DIMCustomer].[ParentPostalNumber].&[]})
MEMBER [Measures].[Sales] AS round(sum(([FINALSET],Others),[Measures].[Metric]),2)
MEMBER [Measures].[Count] as (exists(([FINALSET],Others,[SalesType].[SalesType].&[3]),[DIMCustomer].[ParentPostalNumber].currentmember, "sales")).count
SELECT
non empty {
[Measures].[Sales],
[Measures].[Count]
} ON 0,
NON EMPTY{
FIPS
} ON 1
FROM [cube]
i try to replace one year to {[CropYear].[CropYear].&[2014],[CropYear].[CropYear].&[2015]} but query take 12 minute. here i have one restriction i can not use sub select for year.
Regards,
Manish
Hi,
Is it possible to create a set that will contain calculated members that will be aggregated later after cross joining them with other calculated members without explicitly using aggregate on one of them? I'll give an example.
Let's say I have three dimensions:
products
-> products.hierarchy.product1
-> products.hierarchy.product2
-> products.hierarchy.product3
region
-> region.hierarchy.northern hemisphere
-> region.hierarchy.south hemisphere
-> region.hierarchy.outer space
season:
-> season.hierarchy.summer
-> season.hierarchy.winter
-> season.hierarchy.nuclear winter
Set 1: {
products.hierarchy.product1
,(
products.hierarchy.product2
, products.hierarchy.product3
) as otherProducts
}
Set 2: {
region.hierarchy.northern hemisphere
,(
region.hierarchy.south hemisphere,
region.hierarchy.outer space
) as restOfSpace
}
and then in excel print something like this
|Set1
---------------------------------
Set2*Season|
Some Measure X
which would result in:
| product1
otherProducts
---------------------------------------------------------------------------------------------------------------------------------------------
northern hemisphere x summer| aggregate(existing(measure.X))aggregate(existing(measure.X))
northern hemisphere x winter| aggregate(existing(measure.X))aggregate(existing(measure.X))
northern hemisphere x nuclear winter| aggregate(existing(measure.X))aggregate(existing(measure.X))
restOfSpace x summer| aggregate(existing(measure.X))aggregate(existing(measure.X))
restOfSpace x winter| aggregate(existing(measure.X))aggregate(existing(measure.X))
restOfSpace x nuclear winter| aggregate(existing(measure.X))aggregate(existing(measure.X))
Rafal
Hi,
I pretend to do a Prior MTD calculation on distinct customers and i've tried many versions without success.
My situation is this: i have a fact table 'fct sales' that connects to a time dimension 'dim posting date' through an int 'sk_posting_date', and the time dimension has the date value in 'date' attribute, which, from what i've been reading, is a bad idea, i read that it this relation should be done through a date 'sk_posting_date'. I'd like to know if this is mandatory or recommend, to easy dax calculations related to time.
the time dimension is continuous.
i've tried these in model.bim and immediatly had results in model.bim, which i think it's not good,because in that moment i didn't provide any posting date to the calculations...
Nr Distinct Customers Month -1:=CALCULATE(DISTINCTCOUNT([SK_CUSTOMER]); DATEADD('Dim Posting Date'[Date];-1;MONTH)) result is 4427, which equal to the actual MTD
Nr Distinct Customers Month -1 v2 Marco:=CALCULATE(DISTINCTCOUNT('Fct Sales'[SK_CUSTOMER]);DATESINPERIOD('Dim Posting Date'[Date];MAX('Dim Posting Date'[Date]); -1; MONTH )) result is blank
Nr Distinct Customers Month -1 vt5:=CALCULATE(DISTINCTCOUNT([SK_CUSTOMER]); PARALLELPERIOD('Dim Posting Date'[Date];-1;MONTH)) result is also 4427
Nr Distinct Customers Month -1 vt7:=CALCULATE(DISTINCTCOUNT([SK_CUSTOMER]); DATESBETWEEN('Dim Posting Date'[Date];FIRSTDATE('Dim Posting Date'[Date]);LASTDATE('Dim Posting Date'[Date]))) also 4427
Nr Distinct Customers Month -1 vt8:=CALCULATE(DISTINCTCOUNT([SK_CUSTOMER]);
DATESBETWEEN('Dim Posting Date'[Date];
FIRSTDATE(DATEADD('Dim Posting Date'[Date];-1;MONTH));
LASTDATE(DATEADD('Dim Posting Date'[Date];-1;MONTH))
)) also 4427
Nr Distinct Customers Month -1 v3:=CALCULATE(DISTINCTCOUNT('Fct Sales'[SK_CUSTOMER]);PARALLELPERIOD('Dim Posting Date'[Date];-1;MONTH);ALL('Dim Posting Date')) also 4427
So, i'd like to know what am i doing wrong, and if it is inevitable to re-create the relation between the factual and the time dimension to easy this and other calculations.
Kind regards and TIA
I see we can install SQL Server 2016 CTP2 and Tabular SSAS.
However, where are the tools to allow us to connect to the server and work with the tabular models?
Supporting features such as bi directional filtering, etc...
The existing SSDT BI tools for 2014 don't contain those additional features (editing relationship filtering direction for example).
Hello All,
I am unable to see my DSV when I try to edit my dimension. I have added some new fields in my dimension table and now want to use them in my cube dimension.
I seem to be running into this quite regularly these days. I'm editing an SSAS tabular model, filtering data in the views in VS 2012 to verify that calculations are working, and I get this:
The result is that any work you've done since you last saved is lost, because you won't be able to save. It's really getting quite frustrating.
I did find a post online that went over how you could recover your work from your local workspace SSAS install by reverse engineering/scripting the cube out of it, but that's really not an option in my case since I'm using source control and can't dump my project history every time this happens (and it happens multiple times a day now).
Does anyone know of a workaround for this issue before I open a support incident? Thanks.
Edit: Seems that screenshots don't get persisted to the messages in MSDN forums anymore. Here's the text of what would have been in the screenshot:
"cannot complete the operation because there is no connection to the workspace database that contains the model currently being edited"
Specific steps to re-create. Filter any column in the tabular designer, and when you go to clear the filter if you hit clear before the list of available values populates in the box below, it'll lose connection to the workspace server, and everything will be lost. Any attempt to save will result in:
"Unable to save the file Model.bim. Reason: The file cannot be saved because it is marked as readonly"
Some posted elsewhere about getting past this issue by un-setting the Model.bim file as read-only, or unsetting the entire project directory and it's contents as read-only, but that has not worked on any workstation I have ran into this problem with.
I suspect this is only one of several ways to cause the issue - I know about this one, I try and avoid it, and I still run into problems occasionally.
Hi All,
I have a bridge table used in my current design, the relation ship is FactTable -> DimRoom -> BridgeTable -> BedGrpoup. Fact table is joined with the Dim room dimension on room key, the bridge table maps values from the DimRoom and BedGroup dimension. The scenario I have is that the mapping between room and bed group can change during which I'm recording it in the effective date attribute in the bridge table.Dimension usage on the cube is having a many to many relationship with bridge table.
Example, if a fact occurred in room 100 which belonged to Bed Group A in Jan 2015 and then the room changed to Bedgroup b in feb 2015 and another fact happened in the room then I should have 1 count for jan in A and 1 in B for feb, I get that right when sliced by room, but when I slice by Month the cube does not honour time dim and displays both. I tried mapping the date from the bridge table to the fact as a regular relationship but that does not work either.
Please advise how to solve this issue.
Thanks.
I've created a cube and it processed fine. The calculate command is there. The measure that I'm attempting to run in the SSAS/Visual Studios browser is simply a count rows measure. When I drag the measure to the window, it says no rows available. If I click on the filter that allows nulls, the only change it makes is that it goes from no rows available to "NULL". What am I doing wrong?
Thanks for everyone's help. I need to get this fixed as soon as possible so that I can build my dashboard.
I tried the codeplex forum first, but i see the same question dated from 2010 without any replies so thought I'd try here.
I'm trying to use the Ratio to Parent sproc - http://sqlblog.com/blogs/mosha/archive/2008/09/11/ratio-to-parent-on-rows-in-mdx.aspx
The problem is that the stored proc appears to be pegged at 4 decimal places (which translates to ##.##%). This is losing precision and isn't adding up to 100% when the ratios are summed individually.
Can this be fixed within SSAS or will i need to modify the assp code? .NET decimals are meant to automagically scale, so not sure why it's coming out as (5,4) but my .net coding knowledge is fairly poor.
I get the correct behaviour if hardcode a ratio to parent MDX calc (the resulting ratio has as many decimal points as are required)
Jakub @ Melbourne, Australia Blog
Hi
I have created this member which works as expected expect .. i want it to cut off .. stop at a certain point
CREATE MEMBER CURRENTCUBE.[Measures].[VirtualCount] AS IIF ( [Dim Period FPD].[Period FPD].CURRENTMEMBER.Name = '1' , [Measures].[Contracts Count] , SUM( {[Dim Period FPD].[Period FPD].&[1]}, [Measures].[Contracts Count] ) ), FORMAT_STRING = "#,###.00", VISIBLE = 1;
Below is the result, the green highlights shows this new 'VirtualCount'
Problem is I want it to stop in Period 11 where there is no more active counters ...
Basically what it does is take the contracts count for the first period and displays that amount across all periods. this is for us to keep the original based. later on i will keep the total amounts for those contracts and move that forward as well with some computation ... but that is the next step.
I.W Coetzer
Dear all,
I would like to ask your help in question. I have looked at many books on SSAS and found that almost all of them are based on AdventureWorksDW example. I have found only Brian Larson's book "Delivering Business Intelligence with Microsoft SQL Server 2005" where the autor builds BI-solution from scratch.
So. My question is: does anybody know another SSAS-books, which are not based on AdwentureWorks example?
Regards, Pateykin
Hi. I got this error from a sql agent driven cube process yesterday and am wondering where the log of errors is created...
Executed as user: x\servername$. <return xmlns="urn:schemas-microsoft-com:xml-analysis"><results xmlns="<root">http://schemas.microsoft.com/analysisservices/2003/xmla-multipleresults"><root
xmlns="urn:schemas-microsoft-com:xml-analysis:empty"><Messages xmlns="urn:schemas-microsoft-com:xml-analysis:exception"><Warning WarningCode="1092354050" Description="Server: Operation completed with 1042 problems
logged." Source="Microsoft SQL Server 2008 R2 Analysis Services" HelpFile="" /></Messages></root></results></return>.
The step failed.
Hi All,
I am trying to create aggregation dynamically for each measure group using C# code. But I am getting below error continuously, if anyone has C# working code for this, please share. Please find the error details.
{"Errors in the aggregation designer. The Department Group Key attribute of the Dim Department Group dimension has zero values. The server cannot design aggregations for this attribute.\r\n"}
Thanks,
Moorthy
Dear All,
I am new to TFS , please guide me how to integrate current artifacts with TFS ?
For example : We have multiple applications X, Y, Z each has its own SSIS solution , SQL Script, MSTR report and documentation.
We move code from Dev to Test and then to PROD
How to structure the folders which will be easy to manage and easy to release ?
Please guide me to some resources/videos
Thanks
Anky
hi folks, some workstations are reporting an MS Excel Error Code = 0x80040E64, External Code = 0x00000000:. when attempting to refresh data from a Tabular cube created in SSAS 2012 SP2.
Funny thing, this error may pop up on Excel 2010 x32, x64, Excel 2013 x32, x64 .... so in any of the environments, regardless of the version or platform. It seems that most workstations are behaving fine, but there's some 20% of them that have this issue, above, which does not seem to be related to the memory, on either the server or workstations (plenty available on both).
I've even tried to recreate a spreadsheet from scratch and ultimately, the problem workstations will pop up this error.
This is a small 3mb spreadsheet ... the error pops up immediately upon trying to refresh.
Does this seem an Excel issue or a Tabular one? -- I tried to google the error code but nothing tangible came up.
thanks for any thoughts & pointers,
Cos
SSAS 2008 R2
I have a 2008 R2 cube that has some measures with a monthly granularity and some with a quarterly graularity. I have two diensions set up for dates, one monthly and one quarterly. The end user has requested the ability to view measures of different granualarity side by side in one pivot table, with the quarterly measures remaining blank on the months. Is there anyway to do that?
John Schroeder
.Hi I have a problem. Any one can please help me?
SQL SSAS Cube deployment problem. Connection failed
.Hi I have a problem. Any one can please help me?
SQL SSAS Cube deployment problem. Connection failed