a month ago
Hi!
I´m using new unified story and scripting like to get (first) selection in a table.
var selection = Table.getSelections()[0];
The result contains the id´s of the different dimensions selected. E.g. for cost center
t.S:SAP_ALL_COSTCENTER: "[t.S:SAP_ALL_COSTCENTER].[parentId].&[1234]"
Now I want to identify whether the member of this id is a node (=node of cost center hierarchy) or a leaf (=real cost center).
How could this be achieved easily?
Thanks,
Thomas
Hi ThomasK,
I am working with SAP BW as source. If you are using another source this might not be the solution:
if you use your selection and retrieve the result set for it you can identify if your selection is a hierarchy node or a leaf either from its ID/naming convention or by the exclamation point in front of leafes.
var sel = this.getSelections()[0]["yourDimension"];
console.log(this.getDataSource().getResultSet({"yourDimension": sel, [Alias.MeasureDimension]: "yourMeasure"})[0]);
node: no exclamation point in front of ID and ID starts with 0HIER_NODE. You also get the parent hierarchy node:
leaf => exclamation point in front of ID
br
edgar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi edgar, many thanks for your answer. Forgot to mention that I´m using a SAC planning model. No exclamation mark in this case.
The "&" in SAC doesn´t do the same thing.
t.S:SAP_ALL_COSTCENTER: "[t.S:SAP_ALL_COSTCENTER].[parentId].&[1234]"
In case the member is part of a hierarchy I get the & character. Using flat presentation for the dimension the & is not returned.
BR Thomas
User | Count |
---|---|
75 | |
10 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.