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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 600 views
  • 0 likes
  • 1 in conversation