Skip to content

Instantly share code, notes, and snippets.

@mindspank
Last active April 15, 2016 20:44
Show Gist options
  • Save mindspank/47c8561b85b625fbdb51 to your computer and use it in GitHub Desktop.
Save mindspank/47c8561b85b625fbdb51 to your computer and use it in GitHub Desktop.
Creates a hypercube with dimensionlimits #capabilitiesapi
app.createCube({
qDimensions: [{
qDef: {
qFieldDefs: ["Sales Rep Name"]
},
qShowTotal: false,
qOtherTotalSpec: {
qOtherMode: 'OTHER_COUNTED',
qOtherCounted: {
// Sets the number to limit by
qv: "5"
},
// Suppress the Others row
qSuppressOther: true,
qOtherSortMode: 'OTHER_SORT_DESCENDING'
}
}],
qMeasures: [{
qDef: {
qDef: "=Sum([Sales Amount]) / 1000"
},
qSortBy: {
"qSortByNumeric": -1
}
}],
// Sort by measure first. This ensures
// we are actually limiting by the expresion value
qInterColumnSortOrder: [1,0],
// Set initial data fetch
qInitialDataFetch: [{
qTop: 0,
qLeft: 0,
qHeight: 20,
qWidth: 2
}]
}, function(reply) {
console.log(reply.qHyperCube.qDataPages[0].qMatrix)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment