Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am experimenting with mash ups and trying out the visualisation on the fly. When I try to create a table with a library measure I can't get it to work. It works with library dimensions but not with library measures.
The example in the help gives a columns array as option, but the properites above lists a qHyperCubeDef.
This work
app.visualization.create( 'table', [ "Case Owner Group",
{ "qDef" : { "qDef" : "Avg([Case Duration Time])",
"qLabel" : "Avg Case Duration Time" }, },
{ "qDef" : { "qDef" : "Sum( [Open Cases] )",
"qLabel" : "Open Cases" } } ],
{"title" : "Case Owner Group Case stats"} ).then( function ( visual ) { visual.show( 'QV01' ); } );
This doesn't work
app.visualization.create( 'table',
[
{qDef: {qFieldDefs: ["Employee Status"], "qFieldLabels":["Status"]},
qNullSuppression: true},
{
"qLibraryId": "vpjnFZ",
"qDef": {
"qTags": [],
"qGrouping": "N",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 0
},
"qAggrFunc": "Expr",
"qAccumulate": 0,
"qActiveExpression": 0,
"qExpressions": [],
"autoSort": true,
"cId": "wfNgj",
"numFormatFromTemplate": true,
"textAlign": {
"auto": true,
"align": "left"
}
},
"qSortBy": {
"qSortByNumeric": -1,
"qSortByLoadOrder": 1,
"qExpression": {}
},
"qAttributeExpressions": [
{},
{}
],
"qCalcCond": {}
}
]
,
{"title" : "Case Owner Group Case stats"} ).then( function ( visual ) { visual.show( 'QV01' ); } );
Any ideas?
Hi Karl,
To use a measure from the library you need to specify that it is a measure by adding qTyp: "measure", something like this:
qLibraryId: "vpjnFz",
qType: "measure"
Hope this helps
Erik
When I try this I get this error.
app.obj.app.visualization.get('sKrVkv').then(function(visual){
visual.setOptions( { "qHyperCubeDef": { "qDimensions":[{"qDef": {"qFieldDefs": ["Employee Status"],
"qFieldLabels":["Status"]}
}],
"qMeasures":[] },
"title":"Now improved"
});
visual.show( 'table' );
});
"Patch value not on valid JSON format."
When I remove the fieldDef and label I don't get the error. The title shows "Now improved", and the visualization is incomplete.
app.obj.app.visualization.get('sKrVkv').then(function(visual){
visual.setOptions( { "qHyperCubeDef": { "qDimensions":[{"qDef": {"qFieldDefs": [],
"qFieldLabels":[]}
}],
"qMeasures":[] },
"title":"Now improved"
});
visual.show( 'table' );
});
Hi Karl,
To use a measure from the library you need to specify that it is a measure by adding qTyp: "measure", something like this:
qLibraryId: "vpjnFz",
qType: "measure"
Hope this helps
Erik
Thank you Erik! It works!
Is the default qType "dimension", and that's the reason it's not need for dimension?
I downloaded your mashup on Qlik Branch and it was a great resource for handling the basic stuff.