Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, i'm trying to call either a JScript or VBScript function in Pivot Table. Let's say i have a function called addFive(arg), and i want to use it to modify a column in the table by calling it, and give it an argument another column in the same table, and write the returned result in the column where i've called the function.
IE: in a table there is Units column, and i add a column named total in the table expressions, and i input the following as its definition: =addFive(Units), - (like sum(Units) but i want to implement my own function to communicate with external software).
Thanks in advance.
It's not possible to call vb or js functions in expressions. You can put expressions in variables and pass parameters to variables. For example:
Create a variable vAddFive: $1+5
Use the variable in an expression passing Units as parameter: =$(vAddFive(Units))
This way you can build functions from expressions and variables. The first parameter is $1, the second $2 and so on.
It's not possible to call vb or js functions in expressions. You can put expressions in variables and pass parameters to variables. For example:
Create a variable vAddFive: $1+5
Use the variable in an expression passing Units as parameter: =$(vAddFive(Units))
This way you can build functions from expressions and variables. The first parameter is $1, the second $2 and so on.
Thank you for the information. I have one more question. is it possible to assign a JSCript or VBScript function to that Variable, so i can use the function's result as variable's value?
No. You can only use vb or js functions in the load script and in macro's.
Ok, thank you for your time.