Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6943183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:07:22+00:00 2026-05-27T13:07:22+00:00

I am trying to create a formula for calculating the percentage difference between two

  • 0

I am trying to create a formula for calculating the percentage difference between two running totals. In my report, I have grouped months by Quarter and have created a running total for each quarter. What I need to do now is to add a row for comparing the totals of each quarter using the following formulas:

(Current Quarter - Previous Quarter)/Previous Quarter

Anyway, I was looking at using global variables in order to achieve this. The Crystal Reports formula I have is below. However, when I try to save it I get the following message:

The remaining text does not appear to be part of the formula ( everything after the IF statements is highlighted )

Basically, my goal is to use a global variable to store the previous groups running total in order to calculate the comparisons I need. I was just wondering if this is the correct way to achieve what I need to do or is there a better way? Also, would appreciate any help in fixing the formula posted below.

thanks

Global NumberVar previousTotal;
previousTotal := 0;

WhilePrintingRecords;

if ( previousTotal > 0 )
then (({#Quarter Total}-previousTotal)/previousTotal)

else
0 ;

previousTotal :=({#Quarter Total});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:07:23+00:00Added an answer on May 27, 2026 at 1:07 pm

    Your formula is not returning anything. You need to move some things around in order to get it to work:

    whileprintingrecords;
    numbervar previousTotal;
    local numbervar output;
    
    if previousTotal>0 then output:=(({#Quarter Total}-previousTotal)/previousTotal);
    previousTotal := {#Quarter Total};
    
    output
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a Crystal Reports formula field (to calculate the percentage change
I'm trying to create a report of some data. The data has be grouped
I'm trying to create a formula that will have the effect of automatically adding
Trying to create a small monitor application that displays current internet usage as percentage
The first three columns exist. I am trying to create a formula for the
I have been trying to create a regular expressions pattern that matches any reference
i am trying to create music major scale converter. Dose anyone have info how
I am trying to create a formula for a cost column which calculates the
I am trying to create a report in crystal reports 11 based on this
I'm trying to create a Crystal Report that reads data from an access table.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.