[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Intializing counters



I would suggest to use on-break statement to do the
calculation.

And if you decide to use your code then you have to
move the  $company to $Prev_company without any
condition ie., outside of all the if statements.

consider this code
if $Company = $Prev_Company
           let #Total_Flexcash = #Total_Flexcash +
#Flex
           let $Prev_Company = $Company
       else
          do Print-Totals
          Let #Total_Flexcash = 0
        End-If

        let $Prev_Company = $Company

HOpe this helps


--- "Grewal, Navi A." <navi.grewal@EXELONCORP.COM>
wrote:
> Good Morning,
>  I am trying to calculate flex dollars for each
> company.
> Here is verbally what i am trying to do
> Intialize Total_flex = 0
>  Keep adding flex dollars i.e. is #Flex to
> Total_Flex
>  When old_company not equal to new_company print the
> company and
> flex_dollars
> and set Total_flex to 0 and do it again for each
> company and print out the
> results till i am done with all the companies.
> Can anyone send me a similiar example or guide me
> how to write it.
> Here is what i wrote but i know this is not correct
> can someone guide me
> from here
>
> If #Flex > 0
>       if $Company = $Prev_Company
>           let #Total_Flexcash = #Total_Flexcash +
> #Flex
>           let $Prev_Company = $Company
>       else
>          do Print-Totals
>          Let #Total_Flexcash = 0
>
>       End-If
>    End-If
> Thanks a lot in advance
> Navi
>
>
>
************************************************************************
> This e-mail and any of its attachments may contain
> Exelon Corporation
> proprietary information, which is privileged,
> confidential, or subject
> to copyright belonging to the Exelon Corporation
> family of Companies.
> This e-mail is intended solely for the use of the
> individual or entity
> to which it is addressed.  If you are not the
> intended recipient of this
> e-mail, you are hereby notified that any
> dissemination, distribution,
> copying, or action taken in relation to the contents
> of and attachments
> to this e-mail is strictly prohibited and may be
> unlawful.  If you have
> received this e-mail in error, please notify the
> sender immediately and
> permanently delete the original and any copy of this
> e-mail and any
> printout. Thank You.
>
************************************************************************


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/