Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've tries setting up a qListObject in a mashup, with one dimension, and one extra expression.
However, the expression is always returning blank:
The definition I've been trying is this:
"qFrequencyMode": "R",
"qDef": {
"qFieldDefs": [
"RegionNo"
],
"qSortCriterias": [
{
"qSortByExpression": 1,
"qExpression": {
"qv": "=RegionNo"
}
}
]
},
"qExpressions": [
{
"qDef": {
"qDef": "=Count(RegionNo)"
},
"qLabel": "=Count(RegionNo)",
"qLibraryId": null
}
],
"qInitialDataFetch": [
{
"qHeight": 20,
"qWidth": 2
}
],
"qLibraryId": null
},onDataTest);
The current =Count(RegionNo) is just attempt to avoid any mistakes in Qlik expression. Ideally, it should be replaced by =Only(RegionName).
Both return qText: "-", qNum: "NaN".
Thank you, Erik! Your insight is always appreciated!
Here is a fully working "list", with both a RegionNo, and the RegionName.
It is a hypercube, but it returns all rows, not just the selected rows, like a hypercube does by default.
"qInitialDataFetch": [
{
"qHeight": 20,
"qWidth": 2
}
],
"qDimensions": [
{
"qDef": {
"qFieldDefs": [
"RegionNo"
]
},
"qNullSuppression": true,
"qShowAll": true
}
],
"qMeasures": [
{
"qDef": {
"qDef": "MinString( {< Region=,RegionNo=,RegionName= >} RegionName)"
},
"qLabel": "Region",
"qLibraryId": null,
"qSortBy": {
"qSortByState": 0,
"qSortByFrequency": 0,
"qSortByNumeric": 0,
"qSortByAscii": 1,
"qSortByLoadOrder": 0,
"qSortByExpression": 0,
"qExpression": {
"qv": " "
}
}
}
],
"qSuppressZero": false,
"qSuppressMissing": false,
"qMode": "S",
"qInterColumnSortOrder": [],
"qStateName": "$"
}, onDataTest);
(Sorry Erik, for marking my own answer as correct. But the full code might be better for other people later. Thanks again!)
Hi,
The documentation is sometimes hard to read, but I think it should be:
qExpressions: [
{
qExpr: "=Count(RegionNo)"
}
]
Please let us know if this helps.
Erik Wetterberg
Thank you for your reply!
Unfortunately, qExpr: "=Count(RegionNo)" yields the same result, qText: "-", qNum: "NaN".
The code above is generated by Qlik Sense Feb 2018 SR1, when using the 'Add List' (or 'Add Hypercube'), to the right under Options in Mashup DevHub editor.
I hope that Qlik is generating code that itself understands. But, I guess this is an area that's not used or tested that much, maybe...
Hi,
Didn't realize you used the Mashup Generator, have you tried reporting this as a bug??
Erik Wetterberg
Hi,
You could try with a HyperCube instead. Set qShowAll on the dimension, it should give you all values, like a ListObject.
Erik Wetterberg
Thank you, Erik! Your insight is always appreciated!
Here is a fully working "list", with both a RegionNo, and the RegionName.
It is a hypercube, but it returns all rows, not just the selected rows, like a hypercube does by default.
"qInitialDataFetch": [
{
"qHeight": 20,
"qWidth": 2
}
],
"qDimensions": [
{
"qDef": {
"qFieldDefs": [
"RegionNo"
]
},
"qNullSuppression": true,
"qShowAll": true
}
],
"qMeasures": [
{
"qDef": {
"qDef": "MinString( {< Region=,RegionNo=,RegionName= >} RegionName)"
},
"qLabel": "Region",
"qLibraryId": null,
"qSortBy": {
"qSortByState": 0,
"qSortByFrequency": 0,
"qSortByNumeric": 0,
"qSortByAscii": 1,
"qSortByLoadOrder": 0,
"qSortByExpression": 0,
"qExpression": {
"qv": " "
}
}
}
],
"qSuppressZero": false,
"qSuppressMissing": false,
"qMode": "S",
"qInterColumnSortOrder": [],
"qStateName": "$"
}, onDataTest);
(Sorry Erik, for marking my own answer as correct. But the full code might be better for other people later. Thanks again!)
No, I haven't. Unfortunately, a bug takes longer to get fixed, than making a work around. 😕
Just an additional comment:
The qShowAll is not enough. There has to be an expression as well.