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.

Max() DataWindow function vs. Max() PowerScript function

9 posts in DataWindow Last posting was on 2008-12-09 15:14:20.0Z
"Jason 'Bug' Fenter [TeamSybase]" <NO_SPAMMING_jason.fenter_ Posted on 2008-12-05 21:20:25.0Z
From: "Jason 'Bug' Fenter [TeamSybase]" <NO_SPAMMING_jason.fenter_@_teamsybase.com>
User-Agent: Thunderbird 2.0.0.18 (Windows/20081105)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Max() DataWindow function vs. Max() PowerScript function
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49399b19$1@forums-1-dub>
Date: 5 Dec 2008 13:20:25 -0800
X-Trace: forums-1-dub 1228512025 10.22.241.152 (5 Dec 2008 13:20:25 -0800)
X-Original-Trace: 5 Dec 2008 13:20:25 -0800, vip152.sybase.com
Lines: 9
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88321
Article PK: 417574

I feel like I'm missing something basic here. In PowerScript, Max()
returns the greater of two numbers. In a DataWindow, Max() returns the
largest value in a single column over all rows. I need the PowerScript
functionality in a DataWindow expression.

I have a computed field with a rather long expression in it. I need the
result of that expression to never be below one. If I put it in an if()
statement, then I'm calculating the formula two times (and have to type
it two times).


M. Searer Posted on 2008-12-05 21:52:03.0Z
From: "M. Searer" <nospam@nospam.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49399b19$1@forums-1-dub>
In-Reply-To: <49399b19$1@forums-1-dub>
Subject: Re: Max() DataWindow function vs. Max() PowerScript function
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4939a283@forums-1-dub>
Date: 5 Dec 2008 13:52:03 -0800
X-Trace: forums-1-dub 1228513923 10.22.241.152 (5 Dec 2008 13:52:03 -0800)
X-Original-Trace: 5 Dec 2008 13:52:03 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88322
Article PK: 417573

write a global function f_max(a,b) and call that in your datawindow

"Jason 'Bug' Fenter [TeamSybase]" <NO_SPAMMING_jason.fenter_@_teamsybase.com> wrote in message news:49399b19$1@forums-1-dub...
>I feel like I'm missing something basic here. In PowerScript, Max()
> returns the greater of two numbers. In a DataWindow, Max() returns the
> largest value in a single column over all rows. I need the PowerScript
> functionality in a DataWindow expression.
>
> I have a computed field with a rather long expression in it. I need the
> result of that expression to never be below one. If I put it in an if()
> statement, then I'm calculating the formula two times (and have to type
> it two times).


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-12-06 00:57:14.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49399b19$1@forums-1-dub>
Subject: Re: Max() DataWindow function vs. Max() PowerScript function
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4939cdea$1@forums-1-dub>
Date: 5 Dec 2008 16:57:14 -0800
X-Trace: forums-1-dub 1228525034 10.22.241.152 (5 Dec 2008 16:57:14 -0800)
X-Original-Trace: 5 Dec 2008 16:57:14 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88326
Article PK: 417580

Put the formula in an additional computed field and refer to it. Invisible
in the finished app, temporarily visible for debugging.

"Jason 'Bug' Fenter [TeamSybase]"

<NO_SPAMMING_jason.fenter_@_teamsybase.com> wrote in message
news:49399b19$1@forums-1-dub...
>I feel like I'm missing something basic here. In PowerScript, Max() returns
>the greater of two numbers. In a DataWindow, Max() returns the largest
>value in a single column over all rows. I need the PowerScript
>functionality in a DataWindow expression.
>
> I have a computed field with a rather long expression in it. I need the
> result of that expression to never be below one. If I put it in an if()
> statement, then I'm calculating the formula two times (and have to type it
> two times).


Chris Werner Posted on 2008-12-08 08:44:45.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49399b19$1@forums-1-dub> <4939cdea$1@forums-1-dub>
Subject: Re: Max() DataWindow function vs. Max() PowerScript function
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
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: <493cde7d@forums-1-dub>
Date: 8 Dec 2008 00:44:45 -0800
X-Trace: forums-1-dub 1228725885 10.22.241.152 (8 Dec 2008 00:44:45 -0800)
X-Original-Trace: 8 Dec 2008 00:44:45 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88332
Article PK: 417586

That raises the question how PB's datawindow engine chooses
the calculation order for computed fields. Are computed fields
evaluated in the order they appear in the datawindow syntax?
That would be undeterministic because this order can change
when the datawindow is changed in the painter. Is that described
somewhere? I believe to remember one VPT to avoid referencing
computed fields (even in cumulated fields).

Chris Werner
f+s software gmbh


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> schrieb im
Newsbeitrag news:4939cdea$1@forums-1-dub...

> Put the formula in an additional computed field and refer to it. Invisible
> in the finished app, temporarily visible for debugging.
>
> "Jason 'Bug' Fenter [TeamSybase]"
> <NO_SPAMMING_jason.fenter_@_teamsybase.com> wrote in message
> news:49399b19$1@forums-1-dub...
>>I feel like I'm missing something basic here. In PowerScript, Max()
>>returns the greater of two numbers. In a DataWindow, Max() returns the
>>largest value in a single column over all rows. I need the PowerScript
>>functionality in a DataWindow expression.
>>
>> I have a computed field with a rather long expression in it. I need the
>> result of that expression to never be below one. If I put it in an if()
>> statement, then I'm calculating the formula two times (and have to type
>> it two times).
>
>


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-12-08 13:09:09.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49399b19$1@forums-1-dub> <4939cdea$1@forums-1-dub> <493cde7d@forums-1-dub>
Subject: Re: Max() DataWindow function vs. Max() PowerScript function
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
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: <493d1c75@forums-1-dub>
Date: 8 Dec 2008 05:09:09 -0800
X-Trace: forums-1-dub 1228741749 10.22.241.152 (8 Dec 2008 05:09:09 -0800)
X-Original-Trace: 8 Dec 2008 05:09:09 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88334
Article PK: 417588

Point well taken. I hesitate to suggest setting a computed column - sounds
like a lot of overhead.

"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
news:493cde7d@forums-1-dub...
> That raises the question how PB's datawindow engine chooses
> the calculation order for computed fields. Are computed fields
> evaluated in the order they appear in the datawindow syntax?
> That would be undeterministic because this order can change
> when the datawindow is changed in the painter. Is that described
> somewhere? I believe to remember one VPT to avoid referencing
> computed fields (even in cumulated fields).
>
> Chris Werner
> f+s software gmbh
>
>
> "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> schrieb im
> Newsbeitrag news:4939cdea$1@forums-1-dub...
>> Put the formula in an additional computed field and refer to it.
>> Invisible in the finished app, temporarily visible for debugging.
>>
>> "Jason 'Bug' Fenter [TeamSybase]"
>> <NO_SPAMMING_jason.fenter_@_teamsybase.com> wrote in message
>> news:49399b19$1@forums-1-dub...
>>>I feel like I'm missing something basic here. In PowerScript, Max()
>>>returns the greater of two numbers. In a DataWindow, Max() returns the
>>>largest value in a single column over all rows. I need the PowerScript
>>>functionality in a DataWindow expression.
>>>
>>> I have a computed field with a rather long expression in it. I need the
>>> result of that expression to never be below one. If I put it in an if()
>>> statement, then I'm calculating the formula two times (and have to type
>>> it two times).
>>
>>
>
>


M. Searer Posted on 2008-12-08 23:25:10.0Z
From: "M. Searer" <nospam@nospam.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49399b19$1@forums-1-dub> <4939cdea$1@forums-1-dub> <493cde7d@forums-1-dub>
In-Reply-To: <493cde7d@forums-1-dub>
Subject: Re: Max() DataWindow function vs. Max() PowerScript function
Lines: 48
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <493dacd6@forums-1-dub>
Date: 8 Dec 2008 15:25:10 -0800
X-Trace: forums-1-dub 1228778710 10.22.241.152 (8 Dec 2008 15:25:10 -0800)
X-Original-Trace: 8 Dec 2008 15:25:10 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88346
Article PK: 417600

It seems to use a single or maybe a double pass to determine calculation order.

I have reports which have computes based on other computes.
I also use subtotals that reference those computes rather than rewrite the calculation over and over and over again

My standard report processig does an explicit groupcalc().
If I didn't do the groupcalc(), some of the very complex reports could have some 'unfinished' computes;
98% of my reports don't need the extra groupcalc

So doing what Jerry suggests should work without any problem; and if it doesn't, just add a groupcalc

"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message news:493cde7d@forums-1-dub...
> That raises the question how PB's datawindow engine chooses
> the calculation order for computed fields. Are computed fields
> evaluated in the order they appear in the datawindow syntax?
> That would be undeterministic because this order can change
> when the datawindow is changed in the painter. Is that described
> somewhere? I believe to remember one VPT to avoid referencing
> computed fields (even in cumulated fields).
>
> Chris Werner
> f+s software gmbh
>
>
> "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> schrieb im
> Newsbeitrag news:4939cdea$1@forums-1-dub...
>> Put the formula in an additional computed field and refer to it. Invisible
>> in the finished app, temporarily visible for debugging.
>>
>> "Jason 'Bug' Fenter [TeamSybase]"
>> <NO_SPAMMING_jason.fenter_@_teamsybase.com> wrote in message
>> news:49399b19$1@forums-1-dub...
>>>I feel like I'm missing something basic here. In PowerScript, Max()
>>>returns the greater of two numbers. In a DataWindow, Max() returns the
>>>largest value in a single column over all rows. I need the PowerScript
>>>functionality in a DataWindow expression.
>>>
>>> I have a computed field with a rather long expression in it. I need the
>>> result of that expression to never be below one. If I put it in an if()
>>> statement, then I'm calculating the formula two times (and have to type
>>> it two times).
>>
>>
>
>


Chris Werner Posted on 2008-12-09 08:58:12.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49399b19$1@forums-1-dub> <4939cdea$1@forums-1-dub> <493cde7d@forums-1-dub> <493dacd6@forums-1-dub>
Subject: Re: Max() DataWindow function vs. Max() PowerScript function
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <493e3324$1@forums-1-dub>
Date: 9 Dec 2008 00:58:12 -0800
X-Trace: forums-1-dub 1228813092 10.22.241.152 (9 Dec 2008 00:58:12 -0800)
X-Original-Trace: 9 Dec 2008 00:58:12 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88347
Article PK: 417603

Yes, adding groupCalc() is another VPT which I use very often.
According to the documentation it "Recalculates the breaks in the
grouping levels in a DataWindow" but you are right, it is applicable
in a lot of situations.

I refrained from proposing it here because the OP was concerned
to "calculating the formula two times".

Again, it would be interesting to have some insight how PB's datawindow
engine chooses the calculation order for computed fields (that should be
simple if there are no cyclic definitions) and if there is some multi pass
processing used if needed (cyclic definitions).

BTW thinking about that I get this gut feeling that enforcing a certain
computation order and repeatedly calling groupCalc() until a result
reaches a fixpoint we could account DataWindow computed fields
syntax as complete programming language.

Chris Werner
f+s software gmbh

"M. Searer" <nospam@nospam.com> schrieb im Newsbeitrag
news:493dacd6@forums-1-dub...

> It seems to use a single or maybe a double pass to determine calculation
> order.
>
> I have reports which have computes based on other computes.
> I also use subtotals that reference those computes rather than rewrite the
> calculation over and over and over again
>
> My standard report processig does an explicit groupcalc().
> If I didn't do the groupcalc(), some of the very complex reports could
> have some 'unfinished' computes;
> 98% of my reports don't need the extra groupcalc
>
> So doing what Jerry suggests should work without any problem; and if it
> doesn't, just add a groupcalc
>
>
>
>
> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
> news:493cde7d@forums-1-dub...
>> That raises the question how PB's datawindow engine chooses
>> the calculation order for computed fields. Are computed fields
>> evaluated in the order they appear in the datawindow syntax?
>> That would be undeterministic because this order can change
>> when the datawindow is changed in the painter. Is that described
>> somewhere? I believe to remember one VPT to avoid referencing
>> computed fields (even in cumulated fields).
>>
>> Chris Werner
>> f+s software gmbh
>>
>>
>> "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> schrieb im
>> Newsbeitrag news:4939cdea$1@forums-1-dub...
>>> Put the formula in an additional computed field and refer to it.
>>> Invisible in the finished app, temporarily visible for debugging.
>>>
>>> "Jason 'Bug' Fenter [TeamSybase]"
>>> <NO_SPAMMING_jason.fenter_@_teamsybase.com> wrote in message
>>> news:49399b19$1@forums-1-dub...
>>>>I feel like I'm missing something basic here. In PowerScript, Max()
>>>>returns the greater of two numbers. In a DataWindow, Max() returns the
>>>>largest value in a single column over all rows. I need the PowerScript
>>>>functionality in a DataWindow expression.
>>>>
>>>> I have a computed field with a rather long expression in it. I need the
>>>> result of that expression to never be below one. If I put it in an if()
>>>> statement, then I'm calculating the formula two times (and have to type
>>>> it two times).
>>>
>>>
>>


Jeremy Lakeman Posted on 2008-12-09 09:17:28.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Max() DataWindow function vs. Max() PowerScript function
Date: Tue, 9 Dec 2008 01:17:28 -0800 (PST)
Organization: http://groups.google.com
Lines: 91
Message-ID: <d44b4132-ec5e-4217-90a0-bc9f96c6c0c0@q26g2000prq.googlegroups.com>
References: <49399b19$1@forums-1-dub> <4939cdea$1@forums-1-dub> <493cde7d@forums-1-dub> <493dacd6@forums-1-dub> <493e3324$1@forums-1-dub>
NNTP-Posting-Host: 122.49.134.3
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1228814248 5948 127.0.0.1 (9 Dec 2008 09:17:28 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 9 Dec 2008 09:17:28 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: q26g2000prq.googlegroups.com; posting-host=122.49.134.3; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4,gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!q26g2000prq.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88349
Article PK: 417602


On Dec 9, 6:58 pm, "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote:
> Yes, adding groupCalc() is another VPT which I use very often.
> According to the  documentation it "Recalculates the breaks in the
> grouping levels in a DataWindow" but you are right, it is applicable
> in a lot of situations.
>
> I refrained from proposing it here because the OP was concerned
> to "calculating the formula two times".
>
> Again, it would be interesting to have some insight how PB's datawindow
> engine chooses the calculation order for computed fields (that should be
> simple if there are no cyclic definitions) and if there is some multi pass
> processing used if needed (cyclic definitions).
>
> BTW thinking about that I get this gut feeling that enforcing a certain
> computation order and repeatedly calling groupCalc() until a result
> reaches a fixpoint we could account DataWindow computed fields
> syntax as complete programming language.
>
> Chris Werner
> f+s software gmbh
>
> "M. Searer" <nos...@nospam.com> schrieb im Newsbeitragnews:493dacd6@forums-1-dub...
>
> > It seems to use a single or maybe a double pass to determine calculation
> > order.
>
> > I have reports which have computes based on other computes.
> > I also use subtotals that reference those computes rather than rewrite the
> > calculation over and over and over again
>
> > My standard report processig does an explicit groupcalc().
> > If I didn't do the groupcalc(), some of the very complex reports could
> > have some 'unfinished' computes;
> > 98% of my reports don't need the extra groupcalc
>
> > So doing what Jerry suggests should work without any problem; and if it
> > doesn't, just add a groupcalc
>
> > "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
> >news:493cde7d@forums-1-dub...
> >> That raises the question how PB's datawindow engine chooses
> >> the calculation order for computed fields. Are computed fields
> >> evaluated in the order they appear in the datawindow syntax?
> >> That would be undeterministic because this order can change
> >> when the datawindow is changed in the painter. Is that described
> >> somewhere? I believe to remember one VPT to avoid referencing
> >> computed fields (even in cumulated fields).
>
> >> Chris Werner
> >> f+s software gmbh
>
> >> "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> schrieb im
> >> Newsbeitragnews:4939cdea$1@forums-1-dub...
> >>> Put the formula in an additional computed field and refer to it.
> >>> Invisible in the finished app, temporarily visible for debugging.
>
> >>> "Jason 'Bug' Fenter [TeamSybase]"
> >>> <NO_SPAMMING_jason.fenter_@_teamsybase.com> wrote in message
> >>>news:49399b19$1@forums-1-dub...
> >>>>I feel like I'm missing something basic here. In PowerScript, Max()
> >>>>returns the greater of two numbers. In a DataWindow, Max() returns the
> >>>>largest value in a single column over all rows. I need the PowerScript
> >>>>functionality in a DataWindow expression.
>
> >>>> I have a computed field with a rather long expression in it. I need the
> >>>> result of that expression to never be below one. If I put it in an if()
> >>>> statement, then I'm calculating the formula two times (and have to type
> >>>> it two times).

I inherited a report once that did some calculations entirely in
computes that called global functions or were based on other
computes.
Sometimes the value of one of the fields would be displayed
incorrectly. Then if you scrolled the report up and down to push the
field off screen and back again, it would be displayed correctly.
AFAIK each compute is reevaluated every time it is painted on screen
(at least if a global method is called..).

Setting the background colour of the detail band to rgb(rand(255),rand
(255),rand(255)) certainly gives strange results...


M. Searer Posted on 2008-12-09 15:14:20.0Z
From: "M. Searer" <nospam@nospam.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49399b19$1@forums-1-dub> <4939cdea$1@forums-1-dub> <493cde7d@forums-1-dub> <493dacd6@forums-1-dub> <493e3324$1@forums-1-dub>
In-Reply-To: <493e3324$1@forums-1-dub>
Subject: Re: Max() DataWindow function vs. Max() PowerScript function
Lines: 82
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <493e8b4c@forums-1-dub>
Date: 9 Dec 2008 07:14:20 -0800
X-Trace: forums-1-dub 1228835660 10.22.241.152 (9 Dec 2008 07:14:20 -0800)
X-Original-Trace: 9 Dec 2008 07:14:20 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88355
Article PK: 417607

I too would like to have the calculation logic defined so that we would know what to expect.
It should also allow sybase to test against that logic between versions, ensuring consistent results.

"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message news:493e3324$1@forums-1-dub...
> Yes, adding groupCalc() is another VPT which I use very often.
> According to the documentation it "Recalculates the breaks in the
> grouping levels in a DataWindow" but you are right, it is applicable
> in a lot of situations.
>
> I refrained from proposing it here because the OP was concerned
> to "calculating the formula two times".
>
> Again, it would be interesting to have some insight how PB's datawindow
> engine chooses the calculation order for computed fields (that should be
> simple if there are no cyclic definitions) and if there is some multi pass
> processing used if needed (cyclic definitions).
>
> BTW thinking about that I get this gut feeling that enforcing a certain
> computation order and repeatedly calling groupCalc() until a result
> reaches a fixpoint we could account DataWindow computed fields
> syntax as complete programming language.
>
> Chris Werner
> f+s software gmbh
>
> "M. Searer" <nospam@nospam.com> schrieb im Newsbeitrag
> news:493dacd6@forums-1-dub...
>> It seems to use a single or maybe a double pass to determine calculation
>> order.
>>
>> I have reports which have computes based on other computes.
>> I also use subtotals that reference those computes rather than rewrite the
>> calculation over and over and over again
>>
>> My standard report processig does an explicit groupcalc().
>> If I didn't do the groupcalc(), some of the very complex reports could
>> have some 'unfinished' computes;
>> 98% of my reports don't need the extra groupcalc
>>
>> So doing what Jerry suggests should work without any problem; and if it
>> doesn't, just add a groupcalc
>>
>>
>>
>>
>> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
>> news:493cde7d@forums-1-dub...
>>> That raises the question how PB's datawindow engine chooses
>>> the calculation order for computed fields. Are computed fields
>>> evaluated in the order they appear in the datawindow syntax?
>>> That would be undeterministic because this order can change
>>> when the datawindow is changed in the painter. Is that described
>>> somewhere? I believe to remember one VPT to avoid referencing
>>> computed fields (even in cumulated fields).
>>>
>>> Chris Werner
>>> f+s software gmbh
>>>
>>>
>>> "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> schrieb im
>>> Newsbeitrag news:4939cdea$1@forums-1-dub...
>>>> Put the formula in an additional computed field and refer to it.
>>>> Invisible in the finished app, temporarily visible for debugging.
>>>>
>>>> "Jason 'Bug' Fenter [TeamSybase]"
>>>> <NO_SPAMMING_jason.fenter_@_teamsybase.com> wrote in message
>>>> news:49399b19$1@forums-1-dub...
>>>>>I feel like I'm missing something basic here. In PowerScript, Max()
>>>>>returns the greater of two numbers. In a DataWindow, Max() returns the
>>>>>largest value in a single column over all rows. I need the PowerScript
>>>>>functionality in a DataWindow expression.
>>>>>
>>>>> I have a computed field with a rather long expression in it. I need the
>>>>> result of that expression to never be below one. If I put it in an if()
>>>>> statement, then I'm calculating the formula two times (and have to type
>>>>> it two times).
>>>>
>>>>
>>>
>