Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PivotGrid - OLAP - The E4000 error occurs if filterValues contains an item with the "unknown member" value (T1236954) #28018

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading