Calculated Columns - Can I Declare Variables in Expressions
Hi,
Is it possible to declare ans use a variable in the expression of a calculated column?
Idea was something like:
Dim StockPrev as Integer;
StockPrev:=[EXIST.STKREAL]+[EXIST.QTDENCFOR]-[EXIST.QTDENCCLI]
II(StockPrev<[EXIST.STKREAL] or StockPrev<0),[EXIST.STKMIN]-StockPrev,0)
What i want to return is the result of IIF; but I would like to use variables to make several calculations before.
Thanks
Is it possible to declare ans use a variable in the expression of a calculated column?
Idea was something like:
Dim StockPrev as Integer;
StockPrev:=[EXIST.STKREAL]+[EXIST.QTDENCFOR]-[EXIST.QTDENCCLI]
II(StockPrev<[EXIST.STKREAL] or StockPrev<0),[EXIST.STKMIN]-StockPrev,0)
What i want to return is the result of IIF; but I would like to use variables to make several calculations before.
Thanks
Comments
Not exactly: in this case I was looking at the possibility to do this at the data source level, in the expression of a Calculated Column.
I can create a calculated Column named StkPrev, and assign the expression as:
[EXIST.STKREAL]+[EXIST.QTDENCFOR]-[EXIST.QTDENCCLI]
What I would like to know if I can declare and use variables at this level, or if the use of variables is reserved to the script level.
1. in textobject, the formula is enclosed by square brackets, create expression like this :
EXIST.STKREAL] + [EXIST.QTDENCFOR] - [EXIST.QTDENCCLI
2. use script, more flexible, with c# you can code anything :
then create textobject with expression [StkPrev] , variable StkPrev in script can be used as an expression in textobject.