Thank you, Deepak. Here is how it looks right now in my cube.
The ORDER fn works for me, but the three calc'd fields are returning errors, and I cannot find a code discrepancy:
CODE ADAPTED TO OUR CUBE:
with
set
[LenderRankByLoanVolume] as
Order
([Lender Name].[Master - DBA - Deed Stamp].[Lender Master Entity]
- {
[Lender Name].[Master - DBA - Deed Stamp].[Lender Master Entity].[Miscellaneous]
},
[Measures].[Loan Amount], DESC)
Member
[Measures].[Behind 1st $] as
iif
(
[Lender Name].[Master - DBA - Deed Stamp].[Lender Master Entity].CurrentMember
IS [LenderRankByLoanVolume].Item(0), Null,
( [Measures].[Loan Amount],
[LenderRankByLoanVolume].Item(0)
)
- [Measures].[Loan Amount]
),
FORMAT_STRING
= 'Currency'
Member
[Measures].[Behind 1st %] as
[Measures].[Behind 1st $] /
([Measures].[Loan Amount],
[LenderRankByLoanVolume].Item(0)),
FORMAT_STRING
= 'Percent'
Member
[Measures].[Behind 1st Count] as
iif
(
[Lender Name].[Master - DBA - Deed Stamp].[Lender Master Entity].CurrentMember
is [LenderRankByLoanVolume].Item(0), Null,
( [Measures].[Loan Count],
[LenderRankByLoanVolume].Item(0)
)
- [Measures].[Loan Count]
),
FORMAT_STRING
= '#,#;(#,#)'
SELECT
{[Measures].[Loan Amount],
[Measures].[Loan Count],
[Measures].[Behind 1st $],
[Measures].[Behind 1st %],
[Measures].[Behind 1st Count]} ON 0,
[LenderRankByLoanVolume] ON 1
FROM
[Sales_Loans_Cube]
-----------------------------------------------------------
Returns Results:
|
Loan Amount |
Loan Count |
Behind 1st $ |
Behind 1st % |
Behind 1st Count |
| Lender X |
$1,612,873,402 |
27,359 |
#Error |
#Error |
#Error |
| Lender D |
$764,804,224 |
1,149 |
#Error |
#Error |
#Error |
| Lender A |
$731,280,531 |
15,811 |
#Error |
#Error |
#Error |
| Lender Q |
$708,404,260 |
27,105 |
#Error |
#Error |
#Error |
| etc¡ |
|
|
|
|
|
Do you see any code discrepancy Would additional info or code help
Returns Messages:
Parsing the query ...
Obtained object of type: Microsoft.AnalysisServices.AdomdClient.CellSet
Parsing complete