Welcome :Guest
Congratulations!!!

Top 5 Contributors of the Month
ffttt

### Named Set and Calculated Measure returns #Error values

I'm trying to create a set of measures that will give me a count of how many customer have bought a product that falls in to different levels in a heirarchy (Department -> Category )

I have a fact table that contains OrderDetail records at the SKU level.

My Product dimension contains the hierarchy assoicated to each SKU

My 3 measures are

Measure 1 -  number of items >= 1 and <= 3

Measure 2 - number of items >=4 and <=7

MEasure 3 - number of items >= 8

I have created a names set to cross join all the members in the product hierarchy with the customers

CREATE SET CUBE_A.[NS Customer]

AS { EXISTS

### Measure Dependent Calculated Measure

Hi Was looking to create a calculated Measure Which needs to be dependent on another column of the FACT table. I need to have the Average of the particular Measure based on the fact that this particular 'set' has a common Related dimension's The example would give a better picture. I have a set of dimensions like STUDENT, TEACHER, COURSE etc as my dimensions and the grades, class standing based on marks for the subject, percentage of marks scored, Percentile, Marks Scored,StudentID and the related PK's etc are the measures on my fact table Here I want the Avg of the marks scored by the Students based on the grade say is  A or B or C  I was looking to create a calculated measure by using MDX which was a follows (NOT THE CORRECT SYNTAX JUST THE IDEA) SUM  (MARKS SCORED)/COUNT(DISTINCT StudentID) WHERE GRADE = A As this would be measured against a particular subject or a teacher or a Course. I was hoping if I could get help in putting this in a proper SYNATAX   Thanks in advance.

### Optimize Calculated Measure containing COUNT EXISTING

Hi, My goal is to change the text color of all cells that contain aggregated values. Currently I achieve it like this: I COUNT the members of all attributes of all dimensions. To be multi-select-safe I am using the EXISTING keyword. If the members count of at least one dimension is not 1 than the background color of the cell is changed. CREATE MEMBER CURRENTCUBE .[Measures].[SingleCellSelected]   AS iif ((COUNT (Existing ([Dim1].[Attr1].[ Attr1].MEMBERS ))=1) AND (COUNT (Existing ([Dim1].[Attr2].[Attr2].MEMBERS ))=1) AND (COUNT (Existing ([Dim2].[Attr3].[Attr3].MEMBERS ))=1) AND (COUNT (Existing ([Dim2].[Attr4].[Attr4].MEMBERS ))=1) AND (COUNT (Existing ([Dim3].[Attr5].[Attr5].MEMBERS ))=1),1,0),   VISIBLE = 0  ;    SCOPE ([Measures].AllMembers ); FORE_COLOR (this ) = iif ([Measures].[SingleCellSelected]=1,0,16744448); END SCOPE ; This approach works but it performs badly with attributes with many members. Do you have any idea how to optimize this? Thank you!

### create a calculated member in a cube in SSAS

Hello   I’m trying to create a calculated member in a cube in SSAS and was hoping someone could help.   What I’m looking to do is count the number of occurrences of a value in a field.  I have Status field that contains New, Renewals and Enquiries and another field that contains a count, the problem I have and the reason for this query is the count is set to 0 for Enquiries.   The tSQL equivalent would be something like...   Select Date, Status , count(Status) From aTable Where Status = ‘ENQ’   And to summarise, what I’m looking to do would look something like the below   Date Status Count Commission Apr-10 NEW 1 100 May-10 NEW 1 100 May-10 REN 1 50 Apr-10 ENQ 0 0 May-10 ENQ 0 0 Jun-10 REN 1 50 May-10 NEW 1 100 Just looking at the ENQ by month. Date Count of ENQ     Apr-10 1     May-10 1     Jun-10 0       Any help gratefully received.

### Calculated measure between two dates

Following fact table - Amount - StartDate - EndDate - SomeOtherDate   If the user selects a date in the time dimension I want to build the sum of Amount where the selected date is between StartDate and EndDate. Like this   SELECT SUM(Amount) WHERE <date> between StartDate and EndDate   Is it possible to create a calculated measure like this.   Thanks.

### SSAS 2008 Measure group Distinct count

Hi all, I have a data of as number of trasactions,DD, SO, BouncedDD, CancelledDD all are in count (number) while adding these measures manullay to a measure group I have selected usage as DistinctCount for one measure and for all the remaining measures as DiscinctCount.While deploying the cube it shows error as "Fact table canot have more than one distinct count"

### SSAS - calculation of ssrs report should be calculated before calculation in MDX script

Hi All I have: - A calculated member defined in an mdx query of an SSRS report (using the aggregate function). - A calculated member defined in the MDX Script of the cube The calculated member of the cube calculates a ratio. What we should achieve is the ratio of the aggregated members (defined in the report) and not the aggregation of the ratios. I thought that it would be automatically enforced by: http://msdn.microsoft.com/en-us/library/ms145539.aspx :"The exception to this precedence is the Aggregate function. Calculated members with the Aggregate function have a lower solve order than any intersecting calculated measure." I tried to play with the solve_order of the two calculated members (defining explicitly a lower solve_order for the aggregation defined in the report), but the calculation of the cubes is always executed first => I end up with the aggregation of the ratios. Are calculations defined in the MDX script always executed first? This doesn't seem logical to me.. Thanks a lot for your help. Regards Stefan

### Which version of Excel to install for a calculated measure?

I have a 64bit server running SSAS 2010 and I keep getting an ExcelMDX error when processing my cube. We do use an Excel function called FINV() in a calculated measure. I installed Excel 2007 on the SSAS 2010 server but this did not help (I also tried Excel 2010). I can start Excel on the server so I know it is installed. Does it matter whether I install Excel 32bit or 64bit on the server? How do I verify that Excel is installed correctly for SSAS 2010? Errors and Warnings from Response  MdxScript(Sales and Returns) (94, 8) The '[Excel].[FINV]' function does not exist.Kerry

### SSAS 2008 - I cannot seem to have semi-additive and normal additive measures in the same measure gro

I have a measure group with both conventionally aggregated measures (aggregation type SUM) and semi additive measures (LastNonEmpty). The cube processes them quite happily, and I can view and analyse (slice) them fine, but when I analyse them both together, then the conventionally aggregated measures (aggregation type SUM) always dissapears in favour of the semi additive measures. This is not the case if I analyse conventionally aggregated measures (aggregation type SUM) and semi additive measures (LastNonEmpty) from different measure groups.Why does this happen, and is there a way to overcome this by pref not creating seperate fact sources for the conventionally aggregated measures (aggregation type SUM) and semi additive measures (LastNonEmpty) currently in the same fact source.

### Calculated Measure Help - Comparing Months from two Date Dimensions

Hello:   I have a Measure Group that has two Date dimensions, a Reporting Date and a Fee Paid Date. The Reporting Date and the Fee date is based on the same Dimension, which has a standard YQMD hierarchy. It's very typical. The calculation is called "Fees Paid In Same Period", and it would display the Fees paid if the Reporting Month equals the Fees Paid Month.   How do i do this?   Thanks,

### Calculated Measure scenario with a filtered dimensional attribute

I have a cube with a Measure (A) and a dimension (C).  I've created a Calculated Measure (B) whose tuple is Measure A with the all member of Dimension C.  The Calculated Measure looks like this: ([Measures].[A], [C].[ALL]) Scenario 1 When I place the dimension on a pivot table, the Calculated Measure B reflects the correct value, Measure A by all members of dimension C. Scenario 2 When I place the dimension in the filter area and filter by one or more members, the Calculated Measure B reflects the correct value, Measure A by all members of dimension C.  The same answer as Scenario 1. Scenario 3 When I place the dimension in the pivot table AND filter by one or more members, I am getting a different answer than I want.  It is filtering first by the members selected and then reflecting the Calculated Measure as the All value of ONLY the selected filter members.  I want the calculated Measure to reflect Measure A by all members of dimension C.  (The same number as in the first two scenarios)   Is there any way to create the Calculated Measure differently so that all three scenarios give me the same answer?

### Named Set And Calculated Member within Analysis Services Cube project

Hi there.

I have got the mdx below (titled as MDX In QUERY SsMS) that works fine in SQL Management studio.

I am battling to include it in my Analysis Services project.

Following the logic in the mdx query, I have created the 3 named set and one calculated member (You will see them below), but with no luck.

Please any guidance will do, I desperatly need to include it in my cube

MDX In QUERY SsMS

with

//Get Weeks with sales
set
[WeeksWithSales] as '
{filter(
{[Product].[Product Hierarchy].[SKU DESCR]
*[FinancialDate].[FINANCIAL WEEK].[FINANCIAL WEEK]}
,([Measures].[SLS R]) >0)}
'

//the first week
set

set
[LastWeek] as
'
TAIL(
[FinancialDate].[FINANCIAL WEEK].[FINANCIAL WEEK],1
)'
member
[NumWeeks] as 'count([FirstWeek].item(0).item(1):[LastWeek].item(0))'

select
[NumWeeks] on 0
from
(select [Product].[Product Hierarchy].[SKU DESCR].&[BALL BRIDGESTONE 08 E7 +]&[1041597] on 0
from (select ([FinancialDate].[Financial Calendar].[FINANCIAL MONTH].&[FY2010_MONTH06].parent.parent) on 0
from [TPSMerch]))

### New DSV named query or copy and reuse an existing cube dimensions (is the latter valid) - SSAS 2008

I have a [DateAsAt] table in the DSV. This is linked to 3 fact tables to analyse and slice them from an as at date perspective (lets call them FactA, FactB and FactC). But I want to reuse this dimensions (almost like an alias) and although I have tried this and it seems to work, I just want to follow some due dilligence to make sure what I am doing is valid.

I have not created a new Named Calculation for a new date dimension that will be used in a Transactional way (not an as at way), and in stead simply copied the [DateAsAt] dimension, and pasted it back into the dimensions section of the cube (the default name it was given was [DateAsAt 1], but I changed it to [DateTransaction].

Although the relationship between the [DateTransaction] dimenion's source in the DSV (I.e. [DateAsAt]) is linked to FactA, FactB and FactC, I set a new dimension relationship between [DateTransaction] and FactTransactionD in the Dimension Usage area of the cube.

Is this valid? or MUST I create a seperate source for [DateTransaction] in the DSV and set its relationships there?

### SSAS - Measure sign flipping of FormatString

Hi all

I was wondering what the best way is to flip the sign of a measure's FormatString (not the value).

I need to flip the sign of my measures for display purposes only for certain scenarios (for example for the scenario Actual vs Plan). The calculation of the roll-up must take place using the "normal" unflipped sign.

I was thinking to do it in a similar way than the following currency flipping example

CREATE MEMBER CURRENTCUBE.[MEASURES].[Currency Test]

AS [Measures].[Fact Value],

FORMAT_STRING = “Currency”,

VISIBLE = 1 ;

SCOPE([MEASURES].[Currency Test]);

SCOPE([Account].[Account Structure].&[2]);

LANGUAGE(THIS)=1033;

END SCOPE;

SCOPE([Account].[Account Structure].&[4]);

LANGUAGE(THIS)=2055;

END SCOPE;

END SCOPE;

Is there a better way to do it. Many thanks in advance

Regards

### cummulative calculated measure

HI Guys

i have time Dimemsion and hiriarchy as Year-month-week-day

i have a account Dimension

Actual as measure

i want to create a Calculated measure for Balance Account which is an member in account dimension

i want to create a calculated Cumulative measure for balance sheet account like the below

which should give me sum of cumulative of actual amounts for Required period

Time                           FY2010-Period1      FY2010-Period2      FY2010-Period3

Balance Sheet                  \$2000                      2100                  4100

the above will calculate the Balance of previous month + current month so on

i hope i am making sense

Kind Regards

bhas

Hello,

The issue looks pretty simple yet I got stuck. I want to define the measure [NR Var] as [NR]-[F NR] for years/months/dates before 2009 and [NR]-[FI NR] for 2009 and on. I am using [Year]-[Month]-[Date] hierarchies in the cube. I have defined scope:

Scope ([Measures].[NR Var], {
descendants([Date].[Year - Month - Date].[Year].&[2004], 2, self_before_after),
descendants([Date].[Year - Month - Date].[Year].&[2005], 2, self_before_after),
descendants([Date].[Year - Month - Date].[Year].&[2006], 2, self_before_after),
descendants([Date].[Year - Month - Date].[Year].&[2007], 2, self_before_after),
descendants([Date].[Year - Month - Date].[Year].&[2008], 2, self_before_after)});
this=[NR]-[F NR];
End Scope;

but it does not work for some reason. If I get rid of DESCENDANTS function, it works but applies the scope only to the YEAR level. Another problem with using SCOPE is that it affects [NR Var] only yet I have other calcs derivative of [NR Var] which I want the scope to affect as well.

So I ideally I would like to have something like:

CREATE MEMBER CURRENTCUBE.[Measures].[NR Var] as

case when {
descendants([Date].[Year - Month - Date].[Year].&[2004], 2, self_before_after),
descendants([Date].[Year - Month - Date].[Year].&[2005], 2, self_befor

 Categories:
 ASP.Net Windows Application .NET Framework C# VB.Net ADO.Net Sql Server SharePoint Silverlight Others All