Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: IF Then Else Problem Post Reply Post New Topic
Author Message
bkaukab
Newbie
Newbie
Avatar

Joined: 06 Jul 2011
Location: United States
Online Status: Offline
Posts: 10
Quote bkaukab Replybullet Topic: IF Then Else Problem
     Posted: 12 Jul 2011 at 2:19am
Hi Experts,
 
Being a new person with Crystal i am having alot of problems. can some one help me making this formula .
 
Data is something like this.
 
A #          Desc      PMonth $
1000       PCash       13
1005       HC Fund    15
1010       Rem           17
1025       Desposit    19
1155       Float          20
 
_____________________
Need to write a formula where i am adding first two rows of 1000 & 1005 and  if sum(1010,1025,1155) is greater than zero than add it in sum of 1000&1005.
 
answer should be (13+15)=28  and if (17+19+20)>0 than add this to 28 otherwise do not add it  
Bill
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Jul 2011 at 3:54am
I am guessing this have more to do with the Desc type than the numbers.
If you have consitent useage of the descriptions types you can build two Running Totals and then use those for a formula.
name=RT1
type=sum
field to summarize=pmonth
evaluate=use a formula
ttable.desc in ['PCash','HC Fund']
reset = never (assuming you do not have group level data totals)
 
name=RT2
type=sum
field to summarize=pmonth
evaluate=use a formula
ttable.desc in ['Rem','Deposit','Float']
reset = never (assuming you do not have group level data totals)
your final fomrual would be soomething like
 #RT1 + (if #RT2 is >0 then #RT2 else 0)
IP IP Logged
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