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 5989995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:10:50+00:00 2026-05-22T23:10:50+00:00

I met a problem with sum function: the data have a datetime column and

  • 0

I met a problem with sum function:
the data have a datetime column and I want to get sum of who’s datetime is max. And also there’s anoher group condition.
So I do like:

  1. Add formula maxDatetime: Maximum({datetime}, {groupcondition})
  2. Add new formula for sum ValueToSum: if({datetime} = {@maxDatetime}) then value else 0
  3. Sum the value, add new formula totalValue: Sum({@valueToSum}, {groupcondition})

The result is the sum can’t be processed, it says: ‘valueToSum can’t be sumed’.

I think the causor may be using a maximum value as a condition in step 2. Because when use 1 = 1 to replace the condition, there’s no problem.

Can anyone give some advice?

  • 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-22T23:10:51+00:00Added an answer on May 22, 2026 at 11:10 pm

    We usually solve such kind of problems by creating additional queries and linking them to main data. Because Crystal Reports does only two passes over data – record reading and aggregate calculation, it can’t easily aggregate over already aggregated values.

    Another possibility is to accumulate your ‘totalvalue’ into variable. Something like next may work (needs tweaking probably):

    WhilePrintingRecords();
    NumberVar totalvalue;
    If ({datetime} = Maximum({datetime}, {groupcondition})) 
    then totalvalue:=totalvalue+value 
    else 0
    

    This formula (which displays totalvalue) needs to placed into group footer:

    WhilePrintingRecords();
    NumberVar totalvalue
    

    Somewhere in group header you need another one to reset totalvalue:

    WhilePrintingRecords();
    NumberVar totalvalue:=0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some MET data I want to validate which would look something like
I want to make a PHP JSON data foreach, but I met some problem.
In Programming Pearls I have met the following problem. The question is this: print
I have an implementation that just like gmail application, but have met some problem
Just like hold on in Matlab. I met this problem when i want to
I have met an interesting problem while implementing the Observer pattern with C++ and
Good day! I have met problem with synchronizing threads. I am writing program which
I met a problem while using python(2.6) cgi to show a mime data in
I met a problem like this. class A have a list of class B.
I have met a problem with virtualbox, I hope someone could help me here,

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.