Topic: How sum(col),col1/col2*100
How sum(col),col1/col2*100
How sum(col),col1/col2*100 etc? thank you!
You can use javascript for this. Click 'Add transformer' - 'Scripting' - 'Javascript transformer'. It gives you an example and you can change it according to your needs.
thanks,emilCan you give me an example?It example can't clear!
It can do dimensional analysis,example broken line graph? if yes,give me an example,thank you!
I'm not sure I understand your question completely, but to give an example:
function eval() {
return ((values[0] / values[1]) * 100) ;
}
eval();
Here you have a calculation that is similar to the one you were asking for. 'values[0]' is the first input column, 'values[1]' is the second, etcetera. If you now click 'preview data', you will see your input columns and the new output column with the outcome of the calculation, for example:
1 3 33.33333333333333
1 7 14.285714285714285
5 7 71.42857142857143
In order to do such calculations, you have to ensure that your input columns are numbers and not strings; because if you do "1" + "3" as strings, it will return "13". If you do that with numbers, it will return 4.
Does this help?
function eval() {
return ((values[0] / values[1]) * 100) ;
}
eval();
Here you have a calculation that is similar to the one you were asking for. 'values[0]' is the first input column, 'values[1]' is the second, etcetera. If you now click 'preview data', you will see your input columns and the new output column with the outcome of the calculation, for example:
1 3 33.33333333333333
1 7 14.285714285714285
5 7 71.42857142857143
In order to do such calculations, you have to ensure that your input columns are numbers and not strings; because if you do "1" + "3" as strings, it will return "13". If you do that with numbers, it will return 4.
Does this help?
yes,thank very much!
function eval() {
return ((values["col1"] / values["col2"]) * 100) ;
}
eval();
it good!
function eval() {
return ((values["col1"] / values["col2"]) * 100) ;
}
eval();
it good!
Log in by clicking the login link at the top of the screen
Go back to forum.


