October 20, 2016 at 1:38 pm
I need some help. Im new to MDX and SSAS. I need to convert every value for [FMSA Monthly Activity] under the [Dim FMS Heirarchy].[FMS Reporting Hierarchy].[FMSH Financial Page] starting under the Income Statement and all the levels below that member.
I have been trying this?? Im I on the right path?
-- Convert Revenue To Positive
SCOPE(descendants([Dim FMS Heirarchy].[FMS Reporting Hierarchy].[FMSH Financial Page].&[Income Statement],[Dim FMS Heirarchy].[FMS Reporting Hierarchy].[FMSH Financial Page],SELF_AND_AFTER),[Dim Date].[Current YTD]);
This =(([Measures].[FMSA Monthly Activity].CurrentMember)*(-1));
END SCOPE
October 20, 2016 at 1:45 pm
I'm thinking you could use ABS or IIF (ABS being the easiest and most efficient)
ABS:ABS(([Measures].[FMSA Monthly Activity].CurrentMember))
IIF:IIF
(
[Measures].[FMSA Monthly Activity].CurrentMember >= 0,
[Measures].[FMSA Monthly Activity].CurrentMember,
[Measures].[FMSA Monthly Activity].CurrentMember*(-1)
)
-- Itzik Ben-Gan 2001
October 20, 2016 at 1:54 pm
OK but is the scoping correct? See link on post.
My values are not getting updated.
October 20, 2016 at 2:14 pm
jasonclements32304 (10/20/2016)
OK but is the scoping correct? See link on post.My values are not getting updated.
Why have you included [Dim Date].[Current YTD] in your scope statement?
Also, a good method for troubleshooting scope statements is to use font color formatting...
SCOPE(
descendants(
[Dim FMS Heirarchy].[FMS Reporting Hierarchy].[FMSH Financial Page].&[Income Statement],
[Dim FMS Heirarchy].[FMS Reporting Hierarchy].[FMSH Financial Page],
SELF_AND_AFTER
),
[Dim Date].[Current YTD]
);
This = [Measures].[FMSA Monthly Activity] * (-1);
Fore_Color ( This ) = "255";
END SCOPE;
Data Enthusiast | @SQLbyoBI | www.opifexsolutions.com
October 20, 2016 at 2:27 pm
I guess I don't need it.
I want all of Dim Time to be updated.
SCOPE(descendants([Dim FMS Heirarchy].[FMS Reporting Hierarchy].[FMSH Financial Page].&[Income Statement],[Dim FMS Heirarchy].[FMS Reporting Hierarchy].[FMSH Financial Page],SELF_AND_AFTER));
This =(ABS(([Measures].[FMSA Monthly Activity].CurrentMember)));
Fore_Color ( This ) = "255";
END SCOPE;
This should get me there correct?
October 21, 2016 at 4:30 am
gotcha - in that case, give this one a shot... scope to the leaf level below the [Income Statement] member and let the engine handle the aggregation back up through the levels between.
SCOPE(
DESCENDANTS (
[Dim FMS Heirarchy].[FMS Reporting Hierarchy].[FMSH Financial Page].&[Income Statement],
,
LEAVES
)
);
This = [Measures].[FMSA Monthly Activity] * (-1);
Fore_Color ( This ) = "255";
END SCOPE;
Data Enthusiast | @SQLbyoBI | www.opifexsolutions.com
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply