Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: How to calculate positive value Post Reply Post New Topic
Author Message
ifejza
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Location: Albania
Online Status: Offline
Posts: 11
Quote ifejza Replybullet Topic: How to calculate positive value
    Posted: 31 Aug 2010 at 6:46am
Hi,

In my report i need to calculate sum for positiv and negativ value separatly. How to write formula?

Item 1    50,000
Item 2    12,500
Item 3    -9,000
Item 4     8,000    

   Sum(positive) 70,500 ???
   Sum(negative) -9.000 ???

Thanks in advance.

Imran
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 Aug 2010 at 7:04am

you can either

1. create formulas to do this
2. create variable formulas
3. Create Running totals
 
The easiest for the sample data given is option #1.
Create a formula named "Positive"
if field<0 then 0 else field
SUM the formula field
Create a formual named "Negative"
if field >0 then 0 else field
SUM the formula field
 


Edited by DBlank - 31 Aug 2010 at 7:05am
IP IP Logged
ifejza
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Location: Albania
Online Status: Offline
Posts: 11
Quote ifejza Replybullet Posted: 31 Aug 2010 at 11:27am
Thanks DBlank

I take my data from XML file and real problem was a String type for number field.

I solve my problem and thanks again.

Imran,
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.