I have a table as follows

I am trying to read values of a column to a variable and print the 3rd value in a text box. The column is a calculated measure hence numeric code.
var M12 = Table_8.getDataSource().getResultSet({[Alias.MeasureDimension]:"38850850-4017-4442-8008-019502419147"});
console.log(M12);
Text_12.applyText(M12[3][Alias.MeasureDimension].formattedValue);but the output on text box is
"undefined" .To debug i checked the content of variable M12

Request clarification before answering.
Hi there, just tested this out
GM2 is a calculated measure:

The button contains the code below and writes the value 2,579,505.29 to the text box
*Edit - to write the 3rd value to the text box you need to use M12[2] as the array will start at 0 *
var M12 = Table_1.getDataSource().getResultSet({[Alias.MeasureDimension]:"22176336-1325-4884-a239-522753026413"});
Text_1.applyText( M12[2][Alias.MeasureDimension].formattedValue);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
jbarlowjb
Thank you again for your help.
But it is strange that the solution isn't working for me

here is the code, this time I used a new column with numeric value and not percentage
var M12 = Table_8.getDataSource().getResultSet({[Alias.MeasureDimension]:"13464159-6383-4441-b313-278835384536"});
Text_12.applyText(M12[2][Alias.MeasureDimension].formattedValue);I still get the text output as "undefined"
Regards
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.