for (Selection sel : qDim.getInclusions()) {
ParseTreeNode selectionNode = toOlap4j(sel);
// If a sort Order was specified for this dimension
// apply it for this inclusion
if (qDim.getSortOrder() != null) {
CallNode currentMemberNode = new CallNode(
null,
"CurrentMember",
Syntax.Property,
new DimensionNode(null, sel.getDimension()));
CallNode currentMemberNameNode = new CallNode(
null,
"Name",
Syntax.Property,
currentMemberNode);
selectionNode =
new CallNode(
null,
"Order",
Syntax.Function,
generateSetCall(selectionNode),
currentMemberNameNode,
LiteralNode.createSymbol(
null,
qDim.getSortOrder().name()));
}
// If there are exlclusions wrap the ordered selection
// in an Except() function
if (exceptSet != null) {
selectionNode = new CallNode(
null,
"Except",
Syntax.Function,
generateSetCall(selectionNode),
exceptSet);