Last active
April 15, 2016 20:44
-
-
Save mindspank/47c8561b85b625fbdb51 to your computer and use it in GitHub Desktop.
Creates a hypercube with dimensionlimits #capabilitiesapi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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