-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmondrian_dialect.txt
44 lines (33 loc) · 1.65 KB
/
mondrian_dialect.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Lines starting with a hash are comments.
# Empty lines are ignored
# Caps can be upper/lower/any.
# In the case of upper/lower the MDX query string will be transformed
# to uppercase/lowercase. In the case of any the string is left untouched
# Defaults to any. Caps in the definition are ignored so one can write
# CaPs AnY
caps any
# Aliases are plain string replacements. The syntax is:
# alias string_to_replace=replacement_string
# There is no lexer involved so be aware.
# Trying to alias to little might break the syntax.
# Try to use token separators to clarify what you need. Also note that whitespaces
# in the definition DO COUNT.
alias .member_caption=.caption
alias .properties("member_caption")=.caption
alias .unique_name=.UniqueName
alias .LEVEL_NUMBER=.Properties("LEVEL_NUMBER")
alias .properties("caption")=.caption
# Substitutions try to replace a function with an alternate. The syntax is:
# subs function_definition=expression_definition
# a function definition goes like this:
# FunctionName(%param1,%param2,...%paramx)
# any text can be used after % as long as each param key is different
# The expression uses the same parameters '
# The complete expansion replaces the function and its parameters with the expression
# Substitutions are greedy so it is enough fo write foo(%a,%b%,%c)=foo(%a,foo(%b,%c))
# this will expand a query having foo(a,b,c,d) to foo(a,foo(b,foo(c,d)))
subst CrossJoin(%1,%2,%3)=CrossJoin(%1,CrossJoin(%2,%3))
subst NonEmpty(%1,%2)=Filter(%1,not isEmpty(%2.Item(0)))
#Regex substitutions
regex \[+[_[:alnum:]\.\'\*\+\?[:space:]\\$]+\]+\.+currentmember+\.+LEVEL_NUMBER==CAST( $& AS INTEGER )
# Leave an empty line at the end