0

Task is in terms of currency. in the cube should remain only two dimensions: initial currency and the final. I think it can be done in this way:

SCOPE([Dim Time].[Y-Q-M-D].Members,[Convert Currency].[Member Id].Members,[Source Currency].[Member Id].[All])
//revenue
[Measures].[Value Sum Price]=SUM(Descendants([Source Currency].[Member Id].[AllMembers],,LEAVES),
[Measures].[Value Sum Price]*[Measures].[Value Currency])
//taxes
[Measures].[Value Sum NDS]=SUM(Descendants([Source Currency].[Member Id].[AllMembers],,LEAVES),
[Measures].[Value Sum NDS]*[Measures].[Value Currency])
//Discount
[Measures].[Value Sum Discount]=SUM(Descendants([Source Currency].[Member Id].[AllMembers],,LEAVES),
[Measures].[Value Sum Discount]*[Measures].[Value Currency])
END SCOPE; 

But I have an error:

MdxScript(Sales) (10, 1) Parser: The syntax for '[Measures]' is incorrect. 0 0

Do you know how to fix this?

Celeo
  • 5,583
  • 8
  • 39
  • 41
Asia-ami
  • 3
  • 2

2 Answers2

1

The syntax error occurs because you need a semicolon at the end of each statement, i. e. after each of the three assignments.

FrankPl
  • 13,205
  • 2
  • 14
  • 40
  • 1
    @Asia-ami Sorry, but if you only state "the problem still is not solved", I do not know how to proceed. I need a little bit of information to be able to help. Do you get the same error message? Do you get another error message? What exactly is that message? Do you not get an error message, but the result differs from what you expect? If so, what do you get, and what would you expect? – FrankPl Nov 21 '14 at 13:14
  • SCOPE([Dim Time].[Y-Q-M-D].Members,[Convert Currency].[Member Id].Members,[Source Currency].[Member Id].[All]); //< – Asia-ami Nov 23 '14 at 17:56
  • @Asia-ami The opening `SCOPE` statement needs to be terminated by a semicolon as well (i. e. at the end of the first line). – FrankPl Nov 24 '14 at 17:20
0

I'm agreeing with FankPI. Just a basic search of MSDN (the creators of MDX) takes me here: http://msdn.microsoft.com/en-us/library/ms145989.aspx

This tells me that you are missing a semi-colon infront of the first [Measures]

SCOPE([Dim Time].[Y-Q-M-D].Members,[Convert Currency].[Member Id].Members,[Source Currency].[Member Id].[All])

; //<<here

  //revenue
  [Measures].[Value Sum Price]=SUM(Descendants([Source Currency].[Member Id].[AllMembers],,LEAVES),
  [Measures].[Value Sum Price]*[Measures].[Value Currency])
  //taxes
  [Measures].[Value Sum NDS]=SUM(Descendants([Source Currency].[Member Id].[AllMembers],,LEAVES),
  [Measures].[Value Sum NDS]*[Measures].[Value Currency])
  //Discount
  [Measures].[Value Sum Discount]=SUM(Descendants([Source Currency].[Member Id].[AllMembers],,LEAVES),
  [Measures].[Value Sum Discount]*[Measures].[Value Currency])
END SCOPE; 

If you add this required semi-colon what is the new error message?

whytheq
  • 34,466
  • 65
  • 172
  • 267