cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Analytics cloud script

rish73
Explorer
0 Kudos
123

Hi Community,

I am using SAP SAC on BW Live. My Source is a Bex query with 2 structures, Key figure structure (Columns) and Non-Key Figure Structure (Rows). I have a table with (Row/Column) described above and a Numeric Point (KPI) that needs to show the required row value when the table row is clicked. Since using a structure for (rows) I cannot use Linked analysis as it does not understand the context. (Screenshot below) Table to the right and KPI on the left.

rish73_0-1721978237802.png

 

I am trying to use script to get selected Key per row in the table without success. My result is the Key of the structure, I m not able to get the keys for the objects in the structure. Like listed below.

rish73_1-1721978237809.png

 

I get that by doing the following.

rish73_2-1721978237810.png

 

The issue I have is trying to use script to get selected Key per row in the table. I have tried different combinations of the script below without success.

rish73_3-1721978237811.png

 

Thanks for your help.

JasonYang
Associate
Associate
0 Kudos

Hi,

I've tried the following scripts. They work for me, but I may have misunderstood your question.

var sel = Table_1.getSelections();

console.log(sel);

// var dataContext = {
// "@MeasureDimension": "AQL6ZZ8RRFLVX2239TX0OFR8X",
// "AQL6ZZ8RRFLVX2239TX0OGMUP": "AQL6ZZ8RRFLVX2239TX0OGT69"
// };

var dataContext = sel[0];

var data = Table_1.getDataSource().getData(dataContext);

console.log(data);

//set chart filter

Chart_1.getDataSource().setDimensionFilter("AQL6ZZ8RRFLVX2239TX0OGMUP", dataContext["AQL6ZZ8RRFLVX2239TX0OGMUP"]);

 

JasonYang_0-1723623179743.png

 

Accepted Solutions (0)

Answers (0)