I would like to use DW as limited spreadsheet. Is there a

way to calculate expression dynamically per row for several

coulmns? For example, if I have coulmns and I need to

calculate the maximum value per row of all the coulmns in

computed field coulmn.

Column references in the expression for a computed field are to the same row

as the CF.

So max(col1, col2, col3) sounds like what you need.

Sorry but I have to disagree:

That is correct for the usage of column references in expressions

appropriate

for rows.

> So max(col1, col2, col3) sounds like what you need.

The datawindow function max() isn't appropriate for a row level column

expression. A column reference in such a function references to all values

of the column in a certain row range (group N or all).

Computing the maximum of two column values in a row needs an

expression like

if(col1 > col2, col1, col2)

Thes can be extended for greater number of columns but isn't really

easy to read:

if(col3 > if(col1 > col2, col1, col2) , col3, if(col1 > col2, col1,

col2) )

So it is possible to use the DW as a limited spreadsheet but may

be complicated in certain situations.

Chris Werner

f+s software gmbh

"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> schrieb im

Newsbeitrag news:47edc2f1$1@forums-1-dub...

> Column references in the expression for a computed field are to the same

> row as the CF.

> So max(col1, col2, col3) sounds like what you need.

>

> <Elik> wrote in message news:47ed78e7.4b0c.1681692777@sybase.com...

>>I would like to use DW as limited spreadsheet. Is there a

>> way to calculate expression dynamically per row for several

>> coulmns? For example, if I have coulmns and I need to

>> calculate the maximum value per row of all the coulmns in

>> computed field coulmn.

>

>

You are correct - I must have been thinking of some other language.

And the nested if functions get even uglier if any of the columns allow

nulls...

I think that may be oracle or sqlanywhere???

similar to how Coalesce works

I think that is a good extension to PB, and you should post it to the isug

enhancements...

Thank you all. That was my point that DW expressions are not

rows oriented. I did not understand the part of extension to

PB?

Is there an extesion to PB that alow me to use expresions

per row?

It depends on the function. Aggregate functions such as max and sum refer to

columns over a range of rows. Other functions such as abs or ceiling refer

to the value the column in the individual row.