我有层次结构:TimeDim Dimension下的Month,Monthshort和Year-Quarter-Month,可以使用下面的范围来计算YearToDate(YTD) 范围([TimeDim]。[Year - Quarter - Month]。[Month] .members,[TimeDim]。[Month] .Members);
YTD:
New Connection established!
"GET / HTTP/1.1\r\nHost: localhost:3000\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36\r\nUpgrade-Insecure-Requests: 1\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: en-US,en;q=0.9,zh-TW;q=0.8,zh;q=0.7,zh-CN;q=0.6,ja;q=0.5\r\nCookie: Webstorm-bd646432=4c22f08e-220c-4b65-9fcc-802b1ecc654c\r\n\r\n"
New Connection established!
"GET /favicon.ico HTTP/1.1\r\nHost: localhost:3000\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36\r\nAccept: image/webp,image/apng,image/*,*/*;q=0.8\r\nReferer: http://localhost:3000/\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: en-US,en;q=0.9,zh-TW;q=0.8,zh;q=0.7,zh-CN;q=0.6,ja;q=0.5\r\nCookie: Webstorm-bd646432=4c22f08e-220c-4b65-9fcc-802b1ecc654c\r\n\r\n"
New Connection established!
月份的格式为YYYY-MM全名(例如:2017年10月10日),月份短期为MMM(10月)。如果我根据月份计算出该指标的年初至今可行, 如何根据月短计算YTD?我是否需要创建新范围以根据月份来缩短YTD?我是SSAS的新手。请帮忙
答案 0 :(得分:0)
是的,这需要新的范围。
因为当前作用域在此处包含年份“锚”:[TimeDim].[Year - Quarter - Month].[Year]
。
所有其他问题的答案一旦回答
答案 1 :(得分:0)
我在YTD的以下范围内创建了一个月的时间。从而解决了问题。
Scope([Time Year Month].[Year].members,[Time Year Month].[Year - Month].[Month Short].members);
-- accumulated YTD CALCULATIONS
([Time Calculation].[YTD]=
SUM(
CrossJoin(
{[Time Calculation].[Current Period]},
PeriodsToDate([Time Year Month].[Year - Month].[Year]
)
)
)
);
End Scope;