Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDX format string does not deliver desired format

Status
Not open for further replies.

eo

MIS
Apr 3, 2003
809
SSAS 2005. Herewith please see the cut down MDX code. The first section creates two measures and sets the format as #,#.
The second creates the logic for "DisplayTriangle" within a scope. The third, fourth and fifth sections are scopes where one of the measures is altered depending on the scope in which the users navigates. All formatted okay (requirement for format as #,#), except for the fifth section (where the scope is "triangulation"). I suspect this is because I am multiplying with "DisplayTriangle", but you will see that even that measure has a defined format string of #,#. How can I enforce the required format #,# to apply to the fifth section of the MDX?

I have now run out of ideas on how to correct this. Any ideas?

1:
Code:
CREATE MEMBER CURRENTCUBE.[MEASURES].[ClmGrsPaidIndemOrig]
  AS NULL, FORMAT_STRING = "#,#", VISIBLE = 1;    

CREATE MEMBER CURRENTCUBE.[MEASURES].[DisplayTriangle]
  AS NULL, FORMAT_STRING = "#,#", VISIBLE = 0;

2:
Code:
SCOPE([Triangulation].[ProcessingYear].[All].Children); 
[MEASURES].[DisplayTriangle] = 
    IIF( [Year Of Account].[YearOfAccount].CurrentMember.Properties("KEY", TYPED) - 1 +
        [Triangulation].[ProcessingMonthNumber].CurrentMember.Properties("KEY", TYPED) / 12
        <= VBA!Year(VBA!Now()),
        1, NULL); 
END SCOPE;

3:
Code:
SCOPE([Aggregation Type].[AggregationType].&[Period]);     
    [MEASURES].[ClmGrsPaidIndemOrig] =
        Sum(Descendants([X Conv Granularity].[Dim Ccy Conv Granularity].CurrentMember, , LEAVES)
            , [Measures].[GrsPaidIndemYPROrig] *
            ([MEASURES].[Conversion Rate], [Currency Conversion Type].[CurrencyConvType].CurrentMember)
            ); 
END SCOPE;

4:
Code:
SCOPE([Aggregation Type].[AggregationType].&[Accumulation]);     
    [MEASURES].[ClmGrsPaidIndemOrig] =
        Sum ( {NULL : [Date Transaction].[DateTransaction].CurrentMember}, 
        Sum(Descendants([X Conv Granularity].[Dim Ccy Conv Granularity].CurrentMember, , LEAVES)
            , [Measures].[GrsPaidIndemYPROrig] *
            ([MEASURES].[Conversion Rate], [Currency Conversion Type].[CurrencyConvType].CurrentMember)
            )); 
END SCOPE;

5:
Code:
SCOPE([Aggregation Type].[AggregationType].&[Triangulation]);     
    [MEASURES].[ClmGrsPaidIndemOrig] = [Measures].[DisplayTriangle] *
        Sum ( {NULL : [Triangulation].[Triangulation].CurrentMember}, 
          Sum(Descendants([X Conv Granularity].[Dim Ccy Conv Granularity].CurrentMember, , LEAVES)
            , [Measures].[GrsPaidIndemYPROrig] *
            ([MEASURES].[Conversion Rate], [Currency Conversion Type].[CurrencyConvType].CurrentMember)
            )
          );  
END SCOPE;




EO
Hertfordshire, England
 
Try placing the Scop on your Measure as this is the value that you really are calculating based on dimensional choices. Something like:

Code:
SCOPE([MEASURES].[ClmGrsPaidIndemOrig]);
[Triangulation].[ProcessingYear].[All] = NULL;
[Aggregation Type].[AggregationType].[Period] = NULL;
[Aggregation Type].[AggregationType].[Accumulation] = NULL;
[Aggregation Type].[AggregationType].[Triangulation] = NULL;

[Aggregation Type].[AggregationType].[Period] =
        Sum(Descendants([X Conv Granularity].[Dim Ccy Conv Granularity].CurrentMember, , LEAVES)
            , [Measures].[GrsPaidIndemYPROrig] *
            ([MEASURES].[Conversion Rate], [Currency Conversion Type].[CurrencyConvType].CurrentMember)
            );
...
...
...

End Scope;

Simply define the formula for each dimension member. You also need to apply it to the ALL level to make sure that your aggregates are accurate at that level as well. As you add claclulations to the the levels you set to Null in the begining they will override the Null value.

Obviously I have no way of testing but I followed the way all of my conditional calculations are built.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top