0
CurrentMonthAndAllOfLastYear라는 계산 된 계수가있는 SSRS 보고서에 대한 MDX 쿼리를 개발했습니다.이 값은 이전 달의 순 매출과 함께 현재 달의 순 매출액을 합산해야합니다. 불행히도 계산 된 측정 값은 항상 모든 순 판매 금액을 합한 것 같습니다. MDX는 다음과 같습니다MDX 계산 된 모든 시간에 대한 합계 측정
Sales Month CurrentMonthAndAllOfLastYearAmt
31/01/2013 $0.00 ...
28/02/2013 $0.00 ...
31/03/2013 $0.00 ...
30/04/2013 $18,931.10 ...
31/05/2013 $22,557.22 ...
어떤 도움 것 :
Sales Month CurrentMonthAndAllOfLastYearAmt
31/01/2013 $320,429.60 ...
28/02/2013 $320,429.60 ...
31/03/2013 $320,429.60 ...
30/04/2013 $320,429.60 ...
31/05/2013 $320,429.60 ...
나는 다음과 같은 출력을 필요로 (2012 년 어느 매출이 아니었다) :
WITH
SET [CurrMonth] AS [Sales Period].[Sales Period].CurrentMember --Month
SET [CurrYear] AS ANCESTORS([CurrMonth](0), 2) --Year
SET [PriorYear] AS [CurrYear](0).LAG(1) -- Gets prior Year
MEMBER [Measures].[CurrentMonthAndAllOfLastYearAmt] AS SUM({[CurrMonth], [PriorYear]}, Measures].[Net Sales])
MEMBER [Measures].[Debtors Collection Days] AS ([Measures].[Total Owing Amount] * 90)/[Measures].[CurrentMonthAndAllOfLastYearAmt]
SELECT
{
[Measures].[CurrentMonthAndAllOfLastYearAmt],
[Measures].[Total Owing Amount],
[Measures].[Debtors Collection Days],
[Measures].[Net Sales] } ON COLUMNS,
{
[Sales Period].[Sales Month].[Sales Month].ALLMEMBERS } ON ROWS
FROM (SELECT (YTD(STRTOMEMBER('[Sales Period].[Sales Period].[Sales Month].&[2013-05-31T00:00:00]'))) ON COLUMNS
FROM (SELECT (STRTOSET('[Sales Representative Mirror].[Sales Representative ID].&[261]')) ON COLUMNS
FROM [Sales]))
MDX 조각은 다음과 생산 많이 감사하겠습니다.
좋은 조언을 주셔서 감사합니다. 내 쿼리를 업데이트하고 지금은 다음과 같은 오류 얻을 : 판매 월 \t CurrentMonthAndAllOfLastYearAmt 2013-01-31 \t # 오류 2013년 2월 28일 \t # 오류 2013년 3월 31일 \t # 오류 2013년 4월 30일 \t을 # 오류 2013-05-31 \t # 오류 – user3743432
좋은 조언을 주셔서 감사합니다. 내 쿼리를 업데이트하고 지금은 다음과 같은 오류 얻을 : \t CurrentMonthAndAllOfLastYearAmt 2013-01-31 \t # 오류 2013년 2월 28일 \t # 오류 2013년 3월 31일 \t # 오류 2013년 4월 30일 판매 달 \t # 오류 2013-05-31 \t # 오류 – user3743432
# 오류의 내용을 살펴 봐야합니다. 잘못된 것이 무엇인지 조언해야합니다. icCube에서 나는 단지 디버거를 살펴 보라고했다. ;-) – ic3