简体   繁体   中英

Measure for a month and its previous using a named set SSAS

I have a named set that returns the last 10 weeks from the current week. In the cube browser I get the value of a measure for each week. I want to create another measure that contains the value of the previous week returned by the named set. Something like this :

Weeks       Measure1     Measure2
Week 1         50           40
Week 2         35           50
Week 3         77           35

How to do this using MDX ?

Measure2 will be a tuple of whatever measure you want to show - lets calls it [Measures].[Revenue] and the currentmember of the hierarchy used in the Weeks column lagged by 1.

I don't know the structure of your cube so you'll need to adjust the following:

(
  [Measures].[Revenue],
  [Date].[Calendar Week of Year].CURRENTMEMBER.LAG(1)
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM