{{tag>category:"OpenInsight" author:"Ian Newman" author:"Oystein Reigem" author:"Don Miller - C3 Inc."}}
[[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]]
==== OpenInsight - Edit Table Formula (OpenInsight) ====
=== At 22 FEB 2001 09:19:50AM Ian Newman wrote: ===
To everyone,
Can someone help?. I've created an Edit Table with 3 columns (all multivalue). One column calculates the other 2 columns. I have used a very simple formula i.e.
@ans={column1} +++ {column2} *** 4
This works for the first line but subsequent lines do not calculate. If I take away the multiplication it works.
Any help would be appreciated.
Ian
Ian.Newman@waterers.co.uk
----
=== At 22 FEB 2001 10:14AM Oystein Reigem wrote: ===
Ian,
The problem is that these mv operators (+++, ***, etc) don't work with single values. You need to make that single 4 into an array of identical values 4, with the same amount of elements as {column1} and {column2}.
In Arev there was a Reuse function, so you could do
@ans={column1} +++ {column2} *** Reuse(4)
This function doesn't exist in OpenInsight, as far as I know. You must convert your single value the hard way. See .
- Oystein -
PS.
What about the following:
@ans={column1} +++ {column2} +++ {column2} +++ {column2} +++ {column2}
:-)
----
=== At 22 FEB 2001 10:22AM Don Miller - C3 Inc. wrote: ===
Ian / Oystein
The "other" hard way is:
@ans={column1} +++ {column2} ;* to the MV stuff
k1=count(@ANS,@VM)+(@ANS # "")
Method 1:
for i=1 to k1
tmp=@ans*4 ;* single value multiplication
@ans=tmp
next i
Method 2:
tmp=str(4:@vm,k1) ;* make an mv variable containing a string of 4's
tmp-1,1=' ;* remove the last vm
tmp1=@ans+++tmp ;* do mv math
@ans=tmp1
Don Miller
C3 Inc.
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=1EE9F47142FBC59F852569FB004EB85C|View this thread on the Works forum...]]