cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the values of a measure using scripts? SAC

kevin_structum
Explorer
0 Kudos

Hi All,

I have been searching, on every page and every pdf of documentation but I have not been able to get the values of a measure.

That is, I have a table with different measurements, and I need to extract the values of one of its columns and send it to an array, so that when printing the result on the console it says something like:

0: 123456

1: 212345

2: 312345

3: 412345

4: 512345

or well, something similar but only with the values, no description, id or parentId

I hope you can help me, thanks

View Entire Topic
roy_jin
Participant

Hi Kevin,

You can first try to use "var array = Table_name.getDataSource().getResultSet()" to retrieve the whole table content into an array.

Then loop this array like:

for (var i=0;i<arr.length;i++) { }

In the loop body, you should be able to get the measure value something like:

array[i].['MeasureDimension'].rawValue

You can use console.log(array) to check the structure first, such as the below screenshot example:

kevin_structum
Explorer
0 Kudos

Thank u Roy, I needed just this 😄