Is it possible to do simple calculations with document variables and store the result in a document variable? I have tried many approaches, and can't get the result to store to a variable.
I have a data field that works perfectly, with the following MEL expression:
{val(DOCUMENT.HIGH)/val(DOCUMENT.LOW)}
Where DOCUMENT.HIGH, and DOCUMENT.LOW are defined as positive real numbers.
The results display as decimals, to two decimal places, just like I want them.
I really need to be able to store the result in another document variable to write in a sentence in the chart note, and assign to an OBSTERM for later retrieval.
attempts include:
{DOCUMENT.RATIO = (val(DOCUMENT.HIGH/val(DOCUMENT.LOW))}
{OBSNOW("OBSTERM",val(DOCUMENT.HIGH/val(DOCUMENT.LOW))}
{DOCUMENT.RATIO = (eval(val(DOCUMENT.HIGH/val(DOCUMENT.LOW)))}
among many, many others.
No matter what I've tried, I can't get the calculation to process except for as a standalone MEL expression. I've tried every approach I can think of, and read and reread the MEL guide to no avail.
Any help would be greatly appreciated!
Bentley
Cascade Eye Center
Columbia River Gorge, Oregon
Try -
{DOCUMENT.RATIO = str(val(DOCUMENT.HIGH)/val(DOCUMENT.LOW))}
And make sure DOCUMENT.RATIO is declared first, either as a form field or with
{!DOCUMENT.RATIO} also in the code panel