cancel
Showing results for 
Search instead for 
Did you mean: 

BPC 11 custom measure

0 Kudos
228

Hi experts,

I need to create a custom measure in order to reverse sign of account based on the value of a dimension, in order to do so i created a property named "SIGN" in my dimension with value 0 or 1.

This is my custom measure's code

'IIF([%C_CODE%].CURRENTMEMBER.PROPERTIES("SIGN")="1",-[MEASURES].[/CPMB/SDATA], IIF([%C_CODE%].CURRENTMEMBER.PROPERTIES("SIGN")="0",[MEASURES].[/CPMB/SDATA]),[MEASURES].[/CPMB/SDATA])))';

But it's not working, it gives me an MDX: internal error

I think that my code is not correct

Do you guys have an idea what it might be ?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

You have also a syntax error:

="0",[/CPMB/SDATA]),

Instead of [/CPMB/SDATA] have to be [MEASURES].[/CPMB/SDATA]

Also:

SOLVE_ORDER=3

At the end

You have to be VERY accurate with measure formulas

Check brackets also.

Correct will be:

'IIF([%C_CODE%].CURRENTMEMBER.PROPERTIES("/CPMB/VEPPDTC")="1",-[MEASURES].[/CPMB/SDATA],IIF([%C_CODE%].CURRENTMEMBER.PROPERTIES("/CPMB/VEPPDTC")="0",[MEASURES].[/CPMB/SDATA],[MEASURES].[/CPMB/SDATA]))';SOLVE_ORDER=3

1 - "-"

0 - "+"

Other value - "+"

For clear picture:

'IIF([%C_CODE%].CURRENTMEMBER.PROPERTIES("/CPMB/VEPPDTC")="1",
-[MEASURES].[/CPMB/SDATA],
IIF([%C_CODE%].CURRENTMEMBER.PROPERTIES("/CPMB/VEPPDTC")="0",
  [MEASURES].[/CPMB/SDATA],
  [MEASURES].[/CPMB/SDATA]))';SOLVE_ORDER=3
former_member186338
Active Contributor
0 Kudos

Updated with code

former_member186338
Active Contributor
0 Kudos

And one extra error:

not

/CPMB/VEPPDTC

but

2/CPMB/VEPPDTC

Look on ACCTYPE in standard measure

0 Kudos

Thank you very much, this solved my problem

Answers (2)

Answers (2)

0 Kudos

and where i can find the technical name ?

former_member186338
Active Contributor
0 Kudos

Please, stop posting pseudo "answers" - bad practice!! Use comments!

"where i can find the technical name?" Transaction RSA1 ...

former_member186338
Active Contributor
0 Kudos

For example:

former_member186338
Active Contributor
0 Kudos

In the formular:

CURRENTMEMBER.PROPERTIES("SIGN")

Instead of SIGN you have to use technical name of the property!

0 Kudos

I've changed the name of the property to technical key but it's still not working, the error is : MDX Statement error: internal error

Here is the code:

'IIF([%C_CODE%].CURRENTMEMBER.PROPERTIES("/CPMB/VEPPDTC")="1",-[MEASURES].[/CPMB/SDATA], IIF([%C_CODE%].CURRENTMEMBER.PROPERTIES("/CPMB/VEPPDTC")="0",[/CPMB/SDATA]), [MEASURES].[/CPMB/SDATA]))';

former_member186338
Active Contributor
0 Kudos

soumayaitaazize

Sorry, but please, remove "accepted" status on your own "answer"! It's absolutely wrong

0 Kudos

yes sorry, that's not what i meant to do..

Do you have an idea about where the error comes from please?