Skip to content

Commit

Permalink
PivotGrid - OLAP - The E4000 error occurs if filterValues contains an…
Browse files Browse the repository at this point in the history
… item with the "unknown member" value (T1236954) (DevExpress#27952)
  • Loading branch information
pomahtri committed Sep 9, 2024
1 parent ad19680 commit 61bac36
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,10 @@ const XmlaStore = Class.inherit((function () {

function preparePathValue(pathValue, dataField?) {
if (pathValue) {
pathValue = isString(pathValue) && pathValue.includes('&') ? pathValue : `[${pathValue}]`;
const shouldSkipWrappingPathValue = isString(pathValue) && (
pathValue.includes('&') || pathValue.startsWith(`${dataField}.`)
);
pathValue = shouldSkipWrappingPathValue ? pathValue : `[${pathValue}]`;

if (dataField && pathValue.indexOf(`${dataField}.`) === 0) {
pathValue = pathValue.slice(dataField.length + 1, pathValue.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,28 @@ QUnit.module('Misc', stubsEnvironment, () => {
assert.deepEqual(filterExpr, ['(SELECT {[Product].[Category].[Product].[Category]&}on 0']);
});

QUnit.test('T1236954. Build a correct filter query when a member has unknown member', function(assert) {
this.store.load({
values: [{
dataField: '[Measures].[Calculated Cost]',
}],
columns: [{
dataField: '[Activities - Activities].[Activities]',
filterValues: ['[Activities - Activities].[Activities].[All].UNKNOWNMEMBER',
'[Activities - Activities].[Activities].&[24]',
'[Activities - Activities].[Activities].&[21]'],
}],
rows: [{
dataField: '[Departments - Activities].[Departments]',
}],
});

const filterExpr = this.getQuery().match(/\(select(.+?)on 0/gi);

assert.deepEqual(filterExpr, [
'(SELECT {[Activities - Activities].[Activities].[All].UNKNOWNMEMBER,[Activities - Activities].[Activities].&[24],[Activities - Activities].[Activities].&[21]}on 0',
]);
});
});

QUnit.module('getDrillDownItems', stubsEnvironment, () => {
Expand Down

0 comments on commit 61bac36

Please sign in to comment.