Goo'day, George,

At 17:39 29/12/04 -0500, you wrote:

What is needed is a VSUM() command, or vertical sum.

Say X=VSUM(YDATA,2)  and it will add up all the numbers
  vertically that are in <x,2> of the dynamic array.

Can't say I can think of a single instance where this'd help me. It seems to place an overall "limit" on the contents of a file, and on the database as a whole.


Perhaps I'm wrong, but it appears to me that by wanting a VSUM you are putting the data arrangement 90degrees out of phase.....

Based on the assumption that the file in question is an Order file, it seems to me that you are arranging the Order line items on a field-by-field basis, ie, say field<1> contains, Product 1:vm:Qty of Product 1:vm:Price of Product 1 etc and field<2>, contains the next Product:vm:Qty:vm:Price, and so on. In other words, the Products *always* appear in the 1st value of any field, the Qty is *always" the 2nd value of any field, Price is *always* the 3rd value of any field, and so on....

If that is so, then there is an implied "limit" to the number of Products that can be ordered, (and a need for VSUM), unless you have your Orders staged over many files, this one containing only the line items of an order, another containing the Customer Account details, shipping details, etc....Whereas, if you have, say, the Customer Account No in field<1>, the shipping details in field<2>, the products on field<3> (Product 1:vm:Product 2:vm:Product 3:vm:Product 4, etc) the Quantities on field<4> separated by vm's, the Prices on field<5> separated by vm's, and so on for other "related" fields, Qty Despatched, Qty BackOrdered, etc, etc, only one file is needed, unlimited line-items (ie products ordered) per order, and the data can be displayed simply by using the inherent relationships of fields, values (and sub-values, if you must), ie, Products are field<3> , Quantities are field<4>, Prices are field<5>, and so on.....

DICT ORDER would be:
 3
001 D
002 3
003
004 Product
005 12L
006 M

4
001 D
002 4
003
004  Qty
005 6R
006 M

5
001 D
002 5
003 MR2
004 Price
005 8R
006 M

So, a simple sentence LIST ORDERS 3 4 5 would give a neat, columnar output without the need for complicated DICT items. For example, under the original format just how many fields are occupied with line-item data, and how do you arrive at simple DICT items for the data?

Under the alternative file structure, BASIC routines could also use the construct

FOR I = 1 TO DCOUNT(REC<3>,@VM)
   PRODUCT = REC<3,I>
   QTY = REC<4,I>
   PRICE = REC<5,I>
   etc.....
NEXT I

A total of, say, quantities would be SUM(REC<4>) with absolutely no need for a VSUM.....

<end grandmother-egg-suck-teaching>

I've found over the years that this arrangement of data relationships has always amazed those coming into the MV environment, but the simplicity of the relationships usually soon catches on.....

George

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.299 / Virus Database: 265.6.6 - Release Date: 28/12/04

Regards,

Bruce Nichol
Talon Computer Services
ALBURY        NSW     2640
Australia

http://www.taloncs.com.au

Tel: +61 (0)411149636
Fax: +61 (0)260232119

If it ain't broke, fix it till it is!


-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.299 / Virus Database: 265.6.6 - Release Date: 28/12/04




-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.299 / Virus Database: 265.6.6 - Release Date: 28/12/04 ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to