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.

add computed field to n-up datawindow

3 posts in DataWindow Last posting was on 2008-10-01 04:48:39.0Z
Savi Posted on 2008-09-30 15:20:30.0Z
Sender: 129f.48e242e1.1804289383@sybase.com
From: Savi
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: add computed field to n-up datawindow
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48e243be.12bc.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 30 Sep 2008 08:20:30 -0700
X-Trace: forums-1-dub 1222788030 10.22.241.41 (30 Sep 2008 08:20:30 -0700)
X-Original-Trace: 30 Sep 2008 08:20:30 -0700, 10.22.241.41
Lines: 9
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87879
Article PK: 417134

I have a n-up datawindow(3 rows across) that I need to add a
computed field to. I will use this computed field to
display a result based on a function I wrote to convert
based on the record data. However, when I create a computed
field, I cannot specify which column I would like to use in
the computed field. Is this possible?

Many thanks,
Savi


Jeremy Lakeman Posted on 2008-10-01 03:22:10.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: add computed field to n-up datawindow
Date: Tue, 30 Sep 2008 20:22:10 -0700 (PDT)
Organization: http://groups.google.com
Lines: 19
Message-ID: <f37a210f-bc41-47a4-adab-6c66055f3da0@u28g2000hsc.googlegroups.com>
References: <48e243be.12bc.1681692777@sybase.com>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1222831331 30762 127.0.0.1 (1 Oct 2008 03:22:11 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 1 Oct 2008 03:22:11 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: u28g2000hsc.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.2) Gecko/2008091620 Firefox/3.0.2,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!postnews.google.com!u28g2000hsc.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87892
Article PK: 417147


On Oct 1, 12:20 am, Savi wrote:
> I have a n-up datawindow(3 rows across) that I need to add a
> computed field to.  I will use this computed field to
> display a result based on a function I wrote to convert
> based on the record data.  However, when I create a computed
> field, I cannot specify which column I would like to use in
> the computed field.  Is this possible?
>
> Many thanks,
> Savi

Yes it is.

In an n-up the computes are always evaluated relative to the first row
being displayed.
However you can use relative row references in a compute expression. 0
for this row, 1 for the next, etc. eg;

if( value[1]='x', 1, 2)


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-10-01 04:48:39.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <48e243be.12bc.1681692777@sybase.com> <f37a210f-bc41-47a4-adab-6c66055f3da0@u28g2000hsc.googlegroups.com>
Subject: Re: add computed field to n-up datawindow
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48e30127$1@forums-1-dub>
Date: 30 Sep 2008 21:48:39 -0700
X-Trace: forums-1-dub 1222836519 10.22.241.152 (30 Sep 2008 21:48:39 -0700)
X-Original-Trace: 30 Sep 2008 21:48:39 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87893
Article PK: 417151

Correct. This little trick is hidden away in chapter 20 of the User's Guide:
Referring to next and previous rows
You can refer to other rows in a computed field. This is particularly useful
in N-Up DataWindow objects when you want to refer to another row in the
detail band. Use this syntax:



ColumnName[x]

where x is an integer. 0 refers to the current row (or first row in the
detail band), 1 refers to the next row, -1 refers to the previous row, and
so on.

I have submitted a request to get it into a more prominent place in the
documentation.

"Jeremy Lakeman" <jeremy.lakeman@gmail.com> wrote in message
news:f37a210f-bc41-47a4-adab-6c66055f3da0@u28g2000hsc.googlegroups.com...

On Oct 1, 12:20 am, Savi wrote:
> I have a n-up datawindow(3 rows across) that I need to add a
> computed field to. I will use this computed field to
> display a result based on a function I wrote to convert
> based on the record data. However, when I create a computed
> field, I cannot specify which column I would like to use in
> the computed field. Is this possible?
>
> Many thanks,
> Savi

Yes it is.

In an n-up the computes are always evaluated relative to the first row
being displayed.
However you can use relative row references in a compute expression. 0
for this row, 1 for the next, etc. eg;

if( value[1]='x', 1, 2)