Hello,
I'm using JPivot 1.6.0.
I have a parser error when running a simple MDX query :
JPivot] 15 nov. 2006 17:22:43,626 ERROR [Session ] com.tonbeller.jpivot.olap.mdxparse.parser#report_fatal_error: Fatal error parsing MDX:Fatal error parsing MDX:Couldn't repair and continue parse
invalid symbol "&[1]"
com.tonbeller.jpivot.olap.model.OlapException: java.lang.Exception: Fatal error parsing MDX:Couldn't repair and continue parse
invalid symbol "&[1]"
at com.tonbeller.jpivot.xmla.XMLA_Model.parse(XMLA_Model.java:700)
at com.tonbeller.jpivot.xmla.XMLA_Model.initialize(XMLA_Model.java:158)
-------------------------------------------------
The MDX query is :
select
{[Measures].[Internet Order Quantity], [Measures].[Internet Sales Amount]}
on columns,
{[Date].[Calendar].[Calendar Quarter].&[2004]&[1], [Date].[Calendar].[Calendar Quarter].&[2004]&[2]}
on rows
from [Adventure Works]
where [Customer].[Country].&[France]
-------------------------------------------------
And you can easily reproduce the error with the following code :
XMLA_Model model = new XMLA_Model();
model.setDataSource("PROVIDER=MICROSOFT;;DataSource=Local");
model.setCatalog("Adventure Works");
model.setUri("http://127.0.0.1/olap/msmdpump.dll");
model.setMdxQuery("select "+
"{[Measures].[Internet Order Quantity], [Measures].[Internet Sales Amount]} "+
"on columns, "+
"{[Date].[Calendar].[Calendar Quarter].&[2004]&[1], [Date].[Calendar].[Calendar Quarter].&[2004]&[2]} "+
"on rows "+
"from [Adventure Works] "+
"where [Customer].[Country].&[France]");
try {
model.initialize();
} catch (OlapException e) {
e.printStackTrace();
}
SSAS2005 attribute is not properly supported by JPivot. Take a look at the syntax of your MDX :
....&[2004]&[2]}..
Here MDX parser expects period ('.') between &[2004] and &[2]. This fix requires changes in MDX Parser. You can avoid attribute in SSAS2005 to make JPivot happy.
Here is the fix for this :
Open JLex file 'com\tonebeller\jpivot\olap\mdxparse\mdxparse.lex' and update following token definition (line#99) :
replace
"&"{BRACKETID} { return new Symbol(sym.QUOTED_ID, yytext()); }
with
("&"{BRACKETID})* { return new Symbol(sym.QUOTED_ID, yytext()); }
Note: There is build file to generate java source for scanner (download jflex.jar to generate the scanner)
Here is the fix for this :
Open JLex file 'com\tonebeller\jpivot\olap\mdxparse\mdxparse.lex' and update following token definition (line#99) :
replace
"&"{BRACKETID} { return new Symbol(sym.QUOTED_ID, yytext()); }
with
("&"{BRACKETID})* { return new Symbol(sym.QUOTED_ID, yytext()); }
Note: There is build file to generate java source for scanner (download jflex.jar to generate the scanner)