Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to do dynamic calculation per row in DW

7 posts in DataWindow Last posting was on 2008-04-03 00:32:49.0Z
Elik Posted on 2008-03-28 23:01:59.0Z
Sender: 247e.47ebc3ad.1804289383@sybase.com
From: Elik
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: How to do dynamic calculation per row in DW
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47ed78e7.4b0c.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 28 Mar 2008 15:01:59 -0800
X-Trace: forums-1-dub 1206745319 10.22.241.41 (28 Mar 2008 15:01:59 -0800)
X-Original-Trace: 28 Mar 2008 15:01:59 -0800, 10.22.241.41
Lines: 5
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86572
Article PK: 415832

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.


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-03-29 04:17:53.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <47ed78e7.4b0c.1681692777@sybase.com>
Subject: Re: How to do dynamic calculation per row in DW
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47edc2f1$1@forums-1-dub>
Date: 28 Mar 2008 20:17:53 -0800
X-Trace: forums-1-dub 1206764273 10.22.241.152 (28 Mar 2008 20:17:53 -0800)
X-Original-Trace: 28 Mar 2008 20:17:53 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86573
Article PK: 415833

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.


Chris Werner Posted on 2008-03-29 19:08:50.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <47ed78e7.4b0c.1681692777@sybase.com> <47edc2f1$1@forums-1-dub>
Subject: Re: How to do dynamic calculation per row in DW
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47ee93c2@forums-1-dub>
Date: 29 Mar 2008 11:08:50 -0800
X-Trace: forums-1-dub 1206817730 10.22.241.152 (29 Mar 2008 11:08:50 -0800)
X-Original-Trace: 29 Mar 2008 11:08:50 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86574
Article PK: 415834

Sorry but I have to disagree:

> Column references in the expression for a computed field are to the same
> row as the CF.

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.
>
>


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-03-31 19:35:44.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <47ed78e7.4b0c.1681692777@sybase.com> <47edc2f1$1@forums-1-dub> <47ee93c2@forums-1-dub>
Subject: Re: How to do dynamic calculation per row in DW
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47f13d10$1@forums-1-dub>
Date: 31 Mar 2008 11:35:44 -0800
X-Trace: forums-1-dub 1206992144 10.22.241.152 (31 Mar 2008 11:35:44 -0800)
X-Original-Trace: 31 Mar 2008 11:35:44 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86580
Article PK: 415839

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...

"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
news:47ee93c2@forums-1-dub...
> Sorry but I have to disagree:
>
>> Column references in the expression for a computed field are to the same
>> row as the CF.
>
> 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.
>>
>>
>
>


M. Searer Posted on 2008-04-01 14:18:31.0Z
From: "M. Searer" <nospam@nospam.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <47ed78e7.4b0c.1681692777@sybase.com> <47edc2f1$1@forums-1-dub> <47ee93c2@forums-1-dub> <47f13d10$1@forums-1-dub>
Subject: Re: How to do dynamic calculation per row in DW
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47f24437@forums-1-dub>
Date: 1 Apr 2008 06:18:31 -0800
X-Trace: forums-1-dub 1207059511 10.22.241.152 (1 Apr 2008 06:18:31 -0800)
X-Original-Trace: 1 Apr 2008 06:18:31 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86587
Article PK: 415848

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...

"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> wrote in message
news:47f13d10$1@forums-1-dub...
> 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...
>
> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
> news:47ee93c2@forums-1-dub...
>> Sorry but I have to disagree:
>>
>>> Column references in the expression for a computed field are to the same row
>>> as the CF.
>>
>> 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.
>>>
>>>
>>
>>
>
>


Elik Posted on 2008-04-02 23:50:54.0Z
Sender: 68cf.47f41b20.1804289383@sybase.com
From: Elik
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: How to do dynamic calculation per row in DW
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47f41bde.68de.1681692777@sybase.com>
References: <47f24437@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 2 Apr 2008 15:50:54 -0800
X-Trace: forums-1-dub 1207180254 10.22.241.41 (2 Apr 2008 15:50:54 -0800)
X-Original-Trace: 2 Apr 2008 15:50:54 -0800, 10.22.241.41
Lines: 72
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86592
Article PK: 415853

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?

> 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...
>
>
>
> "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
> wrote in message news:47f13d10$1@forums-1-dub...
> > 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...
> >
> > "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in
> > message news:47ee93c2@forums-1-dub...
> >> Sorry but I have to disagree:
> >>
> >>> Column references in the expression for a computed
> field are to the same row >>> as the CF.
> >>
> >> 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.
> >>>
> >>>
> >>
> >>
> >
> >
>
>


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-04-03 00:32:49.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <47f24437@forums-1-dub> <47f41bde.68de.1681692777@sybase.com>
Subject: Re: How to do dynamic calculation per row in DW
Lines: 80
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47f425b1@forums-1-dub>
Date: 2 Apr 2008 16:32:49 -0800
X-Trace: forums-1-dub 1207182769 10.22.241.152 (2 Apr 2008 16:32:49 -0800)
X-Original-Trace: 2 Apr 2008 16:32:49 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86593
Article PK: 415852

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.

<Elik> wrote in message news:47f41bde.68de.1681692777@sybase.com...
> 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?
>
>> 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...
>>
>>
>>
>> "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
>> wrote in message news:47f13d10$1@forums-1-dub...
>> > 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...
>> >
>> > "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in
>> > message news:47ee93c2@forums-1-dub...
>> >> Sorry but I have to disagree:
>> >>
>> >>> Column references in the expression for a computed
>> field are to the same row >>> as the CF.
>> >>
>> >> 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.
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>>
>>