Hi,
I have what does it seems a simple request that i am not able to fulfil. The idea is so simple: you have a simple data source with more than dimension acting as a row, and a mesaure as a column (see attached picture sample)
What I need is to know the values of dimension columns retrieved on the data source (Button Key, Button Title) for each row . I have tried 2 options:
1) To retrieve the dimension members using getMembers function: this option does not work properly since you need to retrieve 2 arrays: 1 for each column and to assume that the arrays would be ordered following same order than values show in the final query. I have checked that sometimes this is not true
var buttonkey_arr = DS_NAVBAR_BUTTON.getMembers(buttonkeyID, maxNumber);
var buttonntitle_arr = DS_NAVBAR_BUTTON.getMembers(buttonTitleID, maxNumber);
2) Iterate all data cell values and to consider only the ones with data cell values <> 0 (see sample schematic code below)
This option would work fine if it was possible to manage the error that appears when we try to access to data with no values (e.g: some kind of try statement that unfortunately does not exist in BIAL). So, at script completion it does its job but an error message appears.
var buttonkey_arr = DS_NAVBAR_BUTTON.getMembers(buttonkeyID, maxNumber);
var buttontitle_arr = DS_NAVBAR_BUTTON.getMembers(buttonTitleID, maxNumber);
LOG_SCRIPTS.logInfo("Starts Button Iteration");
buttonkey_arr.forEach(function(element, index) {
var buttonKey = element.internalKey;
buttontitle_arr.forEach(function(element2, index2) {
var buttonTitle = element2.internalKey;
var data = DS_NAVBAR_BUTTON.getData("_cdUc0MVHEeW8o4CzqyR0tQ", {"_E9QR8MTdEeW5hcDK-Ktfzw":buttonKey, "_E9SHIMTdEeW5hcDK-Ktfzw":buttonTitle});
LOG_SCRIPTS.logInfo("buttonKey: " + buttonKey);
LOG_SCRIPTS.logInfo("buttonTitle: " + buttonTitle);
LOG_SCRIPTS.logInfo("Cell data: " + data.value);
});
});
Question is: has someone succesfully managed a request such this one? I am using data sources based on UNX relational universes, so I have no option to use "magic" tricks coming from BW or similar.
Thanks,
Alfons