The embodiment of the invention discloses a method and a device for analyzing a multi-dimensional query sentence in an online analysis processing server. The method comprises the following steps of: analyzing a multi-dimensional query sentence and generating a syntactic tree according to an analyzed result, wherein a node of the syntactic tree comprises a horizontal axis object, a longitudinal axis object, a slicing axis object, a calculating member object, a calculating unit object and a custom function CDF object; when a multi-dimensional query expression of various objects on the syntactictree is executed, if a function needs to be called, judging whether the function is a custom function or not according to a function definition of the custom function, if so, entering the executing process of the custom function; otherwise, judging whether the function is a standard function or not according to the function definition of a standard function; and if so, entering the executing process of a marking function. By the embodiment of the invention, the working efficiency of a developer in the development process of the whole OLAP system can be improved.