BookmarkSubscribeRSS Feed
lionchik1999
Calcite | Level 5

have some dim (dim_prod),

and I would like to create a calculated member based on that dim that will do the following:

If the user choose in level3 prod_no 114 I would like that the calculated member will contain 114,113 and 112

in case of choosing 121 it will take 121. 119, 118

If the user choose in level2 prod_no 13 I would like that the calculated member will contain 13,12 and 11 etc..

I tried to do the following, but it didn't work:

([dim_prod].[dim_prod].currentmember + [dim_prod].[dim_prod].currentmember.lag(1) + [dim_prod].[dim_prod].currentmember.lag(2) )

please help.

also attached part of dim product:

Level1   level2  level3

1          11          111

1          11          112

1          11          113

1          11          114

1          11          115

1          11          116

1          11          117

1          11          118

1          11          119

1          12          121

1          12          122

1          12          123

1          12          124

1          12          125

1          12          126

1          12          127

1          12          128

1          12          129

1          13          131

1          13          132

1          13          133

1          13          134

1          13          135

1          13          136

1          13          137

1          13          138

1          13          139

Kind Regards,

Leonid

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 0 replies
  • 613 views
  • 0 likes
  • 1 in conversation