on ‎2023 May 19 3:38 PM
Problem Statement:- Trigonometric functions are not available in "Calculated measures"
So I read a measure from table using Table.getDataSource().getResultSet() and calculated the new array with trigonometric functions like "Math.cos(array_1).
This calculated array is stored in new script variable.
Now How can I add this Script variable (type= Array) to the table?
Or How can I convert this Script variable (type= Array) to new Measure?
Request clarification before answering.
dhiraj_gadhave
Any script variable of type integer/number is available for use as calculation input control in Calculated measure but I do not think you would be able to use an array of type integer.


If you use any variable of type other than number/integer you will get below warning.
Now i am able to assign a value of 5 to this script variable and measure show up accordingly

If I make the variable as array of type integer I do not get error but nothing shows up in calculated measure (it makes sense).
Now if your model is a planning model you can use the API setUserInput(selectedData: Selection, value: string): to set the values in table.
So calculate your trigonometric values and then pass them to setUserInput api.
Hope this helps !!
Please upvote/accept if this helps.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 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.