Create a calculated measure depending on the hierarchy level
With this.selection.dimsToExplore
To choose the value of a calculated measure depending on the exploration level, add a calculated measure that uses the objects
this.selection
and
this.selection.dimsToExplore
allowing to determine the current hierarchy level.
Example:
var dim = "myDimension"; // Dimension ID explored to search in the flow
var niv = -1;
// Look for the dimension in the information flow to get its exploration level
for (var idx = 0; idx < this.selection.dimsToExplore.length; idx++)
{
if (this.selection.dimsToExplore[idx].dim.id == dim)
{
niv = this.selection.dimsToExplore[idx].lPos;
// niv => -1: root level, 0: deepest level (close to root),.. n-1: highest level
break;
}
}
if (niv == 1) return 1234;
else if (niv == 0) return 5678;
else return 0;
With this.selection.dimsToFilter
To choose the value of a calculated measure depending on the exploration level, with filters, add a calculated measure that uses the objects
this.selection
and
this.selection.dimsToFilter
allowing to determine the current hierarchy level.
Example:
var niv = -1;
// Look for the dimension in the information flow to get its exploration level
for (var idx = 0; idx < this.selection.dimsToFilter.length; idx++)
{
if (this.selection.dimsToFilter[idx].dim.id == dim)
{
niv = this.selection.dimsToFilter[idx].lPos;
// niv => -1: root level, 0: deepest level (close to root),.. n-1: highest level
break;
}
}
if (niv == 1) return 1234;
else if (niv == 0) return 5678;
else return 0;