on 2021 Feb 12 5:26 PM
Another SAC App Designer scripting question
I'd like to be able to use a script to drill down in a waterfall chart, the setHierarchylevel() parameter doesn't work
so think I need to use the expandNode() parameter.
I'm struggling to get my head round the expandNode syntax, the Developer guide isn't very clear (to me at least)
If anyone has a working example of this it'd be much appreciated
Example
Waterfall chart containing:
3 Measures - m1, m2, m3
1 Dimension which is part of a hierarchy "Group" > "Row"
The 'expand node' button in the below screenshots is where i'm testing syntax to try and get it working.
1. Waterfall chart
2. Via the UI - the 'expand group' icon functionality is what I'm trying to perform programmatically
(the eventual aim being that the node is expanded during a radio button onClick event)
3. The desired result - the Waterfall chart showing the expanded node / lower hierarchy level
Page 51 of the Developer Handbook provides the following example:
// One node (Location="California") is expanded
Chart_1.getDataSource().expandNode("Location_4nm2e04531",
{ "Location_4nm2e04531": "[Location_4nm2e04531].[State_47acc246_4m5x6u3k6s].&[SA1]",
// California "@MeasureDimension": "[Account_BestRunJ_sold].[parentId].&[Discount]" });
Request clarification before answering.
Hi James,
If you want to expand node(m1) by dimension "Group", you can refer to below script: Chart_1.getDataSource().expandNode("groupId", {[Alias.MeasureDimension]: "m1", "groupId": "groupMemberId"});
The first parameter is dimension id and second parameter is selection context. You need to replace "groupId" with dimension id of "Group" dimension, replace "groupDimensionMember" with dimension member id of "Group" and replace "m1" with measure id of "m1".
To get selection context of node "m1", you can use Chart.getDataSource.getDataSelections API.
console.log(Chart_1.getDataSource().getDataSelections());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
we have exact the same issue. We want to drill down a hierarchie node via script.
If we adapt the script, like Roys, then we alway geht an error message "Cannot read property 'name' of undefined" (developer tools).
This is our script:
Chart_1.getDataSource().expandNode("ZXM_UKKS", {[Alias.MeasureDimension]:"781Y61TCOO1DEVWDJS0DI3MKJ", "ZXM_UKKS": "0HIER_NODE!00000000000000000000002010000000"});
ZXM_UKKS is the hierarchy dimension.
781Y61TCOO1DEVWDJS0DI3MKJ is the keyfigure.
0HIER_NODE!00000000000000000000002010000000 is the hierarchy node, which we want to expand based on the dimension ZXM_UKKS.
Is there a limitation for BW live Connections, to use this feature? How can we solve this?
kind regards,
Martin
How would I do this to expand the current year in a table?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm also trying to use getDataSource().expandNode() to do drill down. It can achieve the requirement, but the tables are keep refreshing after I triggered the expandNode(). Did anyone face this problem before?
I want to achieve click on Year level for one table, all tables drill down to Quarter level. Test script is as below:
G_Selection = Table_2.getSelections();
console.log(["Selections",G_Selection]);
var selection = G_Selection[0];
//console.log(["selection", selection]);
var valMeasure = Table_2.getDataSource().getResultMember("@MeasureDimension",selection);
//var valTime = Table_2.getDataSource().getResultMember("Time",selection);
//console.log(["valMeasure", valMeasure]);
//console.log(["valTime", valTime]);
var expandflag = 0;
//Check whether it's column header
if (valMeasure === undefined)
{
Table_2.getDataSource().expandNode("Time",selection);
Table_1.getDataSource().expandNode("Time",selection);
expandflag = 1;
}
Best Regards & Thanks,
Lilu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
39 | |
15 | |
10 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.