on 02-03-2013 12:54 PM
Hello!
First, sorry if I posted in the wrong place, because it is my first post. This is a question about the BPC Script Logic 10.
I'm having trouble making a "script logic" in BPC 10 which calculates the median (not average) read where all values in that dimension "TYPE" is equal to 1 and record this result in the "TYPE" = 111.
Below a piece of the script, in which the problem occurs:
* When TYPE
* IS 1
* Rec (Expression = Median ([TYPE]. [1], [Measures]. [SignedData]); TYPE = 111) / / ERROR OCCURS HERE
* ENDWhen
* Commit
That is, if you had the following information lines
Line 1: 5
Line 2: 15
Line 3: 22
I want him to severe 15 (median) for each item, playing in TYPE 111.
I think the problem is because Median is an MDX and do not know to use it in code.
Could anyone help me?
Thank you
David
Hi,
I am using the code:
[TIPO].[#111]=MEDIAN({FILTER([REVENDA].[R].Children, ([REVENDA].CurrentMember.Properties("AS")=%AS% or [REVENDA].CurrentMember.Properties("AS")='N') and ([REVENDA].CurrentMember.Properties("TERCEIRO")=%TERCEIRO% or [REVENDA].CurrentMember.Properties("TERCEIRO")='N'))},[TIPO].[11])
It was working, but now is giving error in executing the mdx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried the code below. Shows no error, but the calculation is not done correctly.
I'm trying to use AVG initially to facilitate the calculation is being done correctly.
*XDIM_MEMBERSET CAT_APURACAO = 1
*XDIM_MEMBERSET PERIODO_APURACAO = 2
*XDIM_MEMBERSET TIME = NONE
*XDIM_MEMBERSET TIPO = 11
[TIPO].[#11]=AVG({[TIPO].[111],[REVENDA].AllMembers}) //here the code
*COMMIT
In case you have 4 members in the dimension [REVENDA]. Each member has the following values in the dimension [TIPO] = 111:
First: 6515295
Second: 4633418
Third: 5666779
Bedroom: 3103285
The average was 4,979,694 and 5,150,098 median. That is, the calculation using AVG, he should write to each [REVENDA] the value 4979694. However, it is writing 28861790 in 4 members. Someone could tell what is wrong??
Note: AVG used to facilitate the conference, what I really need is the median.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
try please
* Rec (Expression = Median ([TYPE]. [1], [Measures]. [SignedData]); TYPE = "111")
Kind regards
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi DAvid,
then you should try with *MEMBERSET or *OLAPLOOKUP instruction, see please http://help.sap.com/saphelp_bpc75/helpdata/en/ef/2dfc9c47e748d7a6d6b4c2a88675e9/content.htm
http://help.sap.com/saphelp_bpc75/helpdata/en/a2/d8d4710d8f4f688ab197596e118db1/content.htm
Kind regards
Roberto
User | Count |
---|---|
15 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.