Quick & While Retrieving

Deskin, Bob Bob.Deskin at Cognos.COM
Fri Jul 1 10:38:34 CDT 2005


The CACHE solution will work if you have 255 rows/records or fewer. If you can't be sure, then the WHILE RETRIEVING method is the way to go. Declare the DETAIL file again but as a DESIGNER file and give it an ALIAS. You can then accumulate your total into a temporary item using a WHILE RETRIEVING in the POSTFIND procedure. The reason for using that procedure is that at that point you have retrieved a PRIMARY row/record and have the index information for the DETAIL.

The downside of all of this is that if you're adding/updating/deleting records, you have to keep track of the changes to the total yourself. This is why many people break with normalization rules and put the total into the PRIMARY file and use a SUM INTO option to let PowerHouse keep the total automatically. There are many other approaches. For example, I've seen a separate file that just has the key for the PRIMARY and the total. This value is computed each time the screen is entered so it's always fresh.

Having said all this, you may have problems if you have more than one user dealing with the same PRIMARY and DETAIL chain at the same time.

Bob

-----Original Message-----
From: powerh-l-bounces+bob.deskin=cognos.com at lists.sowder.com
[mailto:powerh-l-bounces+bob.deskin=cognos.com at lists.sowder.com]On
Behalf Of Chris Sharman
Sent: July 1, 2005 5:06 AM
To: Matthew Cox
Cc: powerh-l at lists.sowder.com
Subject: Re: Quick & While Retrieving


Matthew Cox wrote:
> I'm new to Powerhouse and have a question regarding While Retieving in
> Quick. I have a screen that has a master record in the top half of the
> layout and a detail section being done with a cluster command on the bottom
> half. My problem is the cluster section displays 12 lines of information and
> a total field below the cluster. The total line is not adding in any detail
> records if the number of detail records is more than 12. Can I use While
> Retrieving to total the cost together for all the detail records being
> selected by the master record? Where do I put the While Retrieving loop? Any
> help is greatly appreciated

while retrieving is mainly for designer files.

You've presumably got "occurs 12" - have you got a "cache" or "cache 
255" or something too ?
This was introduced around 7.10 (depending on platform) to allow PH to 
read & handle more records than it displayed - up to a limit of 255.
You don't say what platform/version you've got.
If you can't use cache, then probably you do need a very clunky solution 
with extra designer files and while retrieving, but using cache in a 
newer version would be the much preferred route.

Any "FOR <detail>" code you have will continue to work, and there's "FOR 
DISPLAYED <detail>" should you want it.

Chris

Any views expressed in this message are those of the sender and not necessarily those of CCA Group.  The unauthorized use, disclosure, copying or alteration of this message is forbidden.  The contents of this message may be confidential and/or privileged, copyright CCA Group and are intended solely for the use of the individual or entity to whom they are addressed.  Whilst this message has been scanned, CCA Group cannot guarantee that it is virus free or compatible with your systems and accepts no responsibility for any loss or damage arising from its use. The recipient is advised to run their own anti-virus software. If you receive this message in error please contact postmaster at ccagroup.co.uk immediately, destroy any copies and delete it from your computer systems.

-- 
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l at lists.sowder.com
Subscribe: "subscribe" in message body to powerh-l-request at lists.sowder.com
Unsubscribe: "unsubscribe &lt;password&gt;" in message body to powerh-l-request at lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber. 
  
       This message may contain privileged and/or confidential information.  If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so.  Thank you. 
        
 



More information about the powerh-l mailing list