Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a (maybe beginner question) where I did not find a proper solution for.
In the front end (in a textbox) it is possible to use following formula: =sum(CL_Complete)/sum(Box_Complete), which gives me in my example a 427.
This number 427 I really would like to put in a variable in the script. Both fields are in one and the same table, but I dont have a clue how to do.
I tried it with a LET statement after loading the table, so the fields are loaded already... but it did not work
LET vL.CLperBox_calc = '=sum(CL_Complete)/sum(Box_Complete)';
LET vL.CLperBox = $(vL.CLperBox_calc);
Can anybody help me to figure out, how to get this solo number in a variable or alternatively in a solo (new) field, in a new table?
Best Regards,
Chris
Maybe like this, added after you have loaded the data table in the script:
AggregatedValue:
LOAD
Sum(CL_Complete) / Sum(Box_Complete) as NewField
RESIDENT YourAlreadyLoadedTableName;
Let vNumber = Peek('NewField',0,'AggregatedValue');
did u try like this ,
adding variable in variable overview like
vt =sum(sales)/sum(amount)
use in text object =vt is the condition ..
--> Alt + Ctrl + V
-->V_variable = sum(CL_Complete)/sum(Box_Complete)
-->Select a text object
--> =V_variable in the expression