is tis code work for the requirement ?
MEMBER [MEASURES].[LTD] AS
'IIF([%KONTO%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC",
(SUM(PERIODSTODATE([%TID%].[LEVEL00], [%TID%].CURRENTMEMBER),-[MEASURES].[/CPMB/SDATA])+( SUM(OPENINGPERIOD([%TID%].[LEVEL00]):ANCESTOR([%TID%].CURRENTMEMBER,[%TID%].[LEVEL00]).PREVMEMBER, -[MEASURES].[/CPMB/SDATA]))) ,
IIF([%KONTO%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="EXP",
(SUM(PERIODSTODATE([%TID%].[LEVEL00], c.CURRENTMEMBER),[MEASURES].[/CPMB/SDATA])+( SUM(OPENINGPERIOD([%TID%].[LEVEL00]):ANCESTOR([%TID%].CURRENTMEMBER,[%TID%].[LEVEL00]).PREVMEMBER, [MEASURES].[/CPMB/SDATA]))),
IIF([%KONTO%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="AST",([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TID%].[LEVEL02])),
IIF([%KONTO%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="LEQ",-([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TID%].[LEVEL02])),-[MEASURES].[/CPMB/SDATA]))))';SOLVE_ORDER=3