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.

Computed fields and summary totals

2 posts in PB Infomaker Report Writer Last posting was on 1997-07-28 17:35:08.0Z
Mike Willison Posted on 1997-07-25 11:32:40.0Z
Newsgroups: sybase.public.infomaker.general
From: "Mike Willison" <mikew@wynalda.com>
Subject: Computed fields and summary totals
X-Newsreader: Microsoft Internet News 4.70.1155
Date: Fri, 25 Jul 1997 07:32:40 -0400
Lines: 22
Message-ID: <348_01bc98fa$061ad900$4b3284cd@wynalda..com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:7491
Article PK: 244547

I am having a problem with computed fields and summary totals. I have a
grouped infomaker report that has 1 to many detail lines per band. I am
computing totals based on information contained in the last row of each
detail band due to the nature of the select statement. In the trailer band
of group 2 (inner band) I can do something like
sum(field 1) / last(field 2 for group 2). I'll call this field groupsum.
In the trailer band of
group 1 (outer band) if I do sum(groupsum for group 2) I get the first
value of groupsum not the total of all of the groupsums. If I do
sum(groupsum) I get 0. and if I do sum(groupsum for all) I get 0. I get
the same results using cumulativesum as well. Does anyone have any ideas
about how to get around this so that I can do groupsums in the outer bands.
BTW I am using Infomaker 5.0.3.

TIA, Mike


Terry Dykstra Posted on 1997-07-28 17:35:08.0Z
Newsgroups: sybase.public.infomaker.general
From: "Terry Dykstra" <tdykstra@cfol.ab.ca>
Subject: Re: Computed fields and summary totals
X-Newsreader: Microsoft Internet News 4.70.1161
Date: Mon, 28 Jul 1997 13:35:08 -0400
Lines: 43
Message-ID: <348_01bc9b84$fda26d00$8366e4cf@tdykstra.cfol.ab.ca>
References: <348_01bc98fa$061ad900$4b3284cd@wynalda..com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:7484
Article PK: 244540

You cannot sum sum-fields. Sum's only work off the detail rows.
Often the easiest is to place a nested report in the groupband that does
the required calculation.
The other way is to create a dummy field on the detail band:

Let's say contract_type is the field used for group 2:

dummy = if ( contract_type[-1] = contract_type, 0, last(
transfers_in_qty for group 2) )

This will check that whenever the group changes, the first row in the
detail band within this group has the value of the last row of group 2. I
am using a technique whereby I reference a value of a previous row [-1].
Now you can use sum(dummy)

Hopefuly this will give you enough ideas to get going.
Terry Dykstra (TeamPS)

Mike Willison <mikew@wynalda.com> wrote in article
<01bc98fa$061ad900$4b3284cd@wynalda..com>...
> I am having a problem with computed fields and summary totals. I have a
> grouped infomaker report that has 1 to many detail lines per band. I am
> computing totals based on information contained in the last row of each
> detail band due to the nature of the select statement. In the trailer
band
> of group 2 (inner band) I can do something like
> sum(field 1) / last(field 2 for group 2). I'll call this field groupsum.
> In the trailer band of
> group 1 (outer band) if I do sum(groupsum for group 2) I get the first
> value of groupsum not the total of all of the groupsums. If I do
> sum(groupsum) I get 0. and if I do sum(groupsum for all) I get 0. I get
> the same results using cumulativesum as well. Does anyone have any ideas
> about how to get around this so that I can do groupsums in the outer
bands.
> BTW I am using Infomaker 5.0.3.
>
> TIA, Mike
>