admin管理员组文章数量:1123227
I have a measure with totals for specific dates with the LastNonEmpty aggregation, and a measure with turnovers with the Sum aggregation.
Help create a measure with totals for each day that would take into account the last known totals + turnovers from the date of the last totals to the current date.
I tried to get the date of the last totals for each date with this request
WITH
MEMBER [Measures].[LastNonEmptyDate] AS
tail(
filter(
periodstodate([date].[calendar].[Date Key],[date].[calendar].currentmember),
NOT ISEMPTY([Measures].[totals])
), 1
).item(0).member_caption
SELECT
{ [Measures].[LastNonEmptyDate] } ON COLUMNS,
[date].[calendar].[Date Key].MEMBERS ON ROWS
FROM [test]
I get null
for all members except those where the current date matches the totals date let's say there are totals for 20240101 for 20240101 I get the date 20240101, and for 20240102 it's already null
, although the intended value should be 20240101
本文标签: sql serverMDX SSAS Calculated measure for last totalsturnoversStack Overflow
版权声明:本文标题:sql server - MDX SSAS Calculated measure for last totals + turnovers - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736557418a1944597.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论