Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Condition Maximum Post Reply Post New Topic
Author Message
Redondo
Newbie
Newbie


Joined: 24 Oct 2013
Location: Portugal
Online Status: Offline
Posts: 9
Quote Redondo Replybullet Topic: Condition Maximum
     Posted: 20 Dec 2013 at 12:05am
Hi,
I intend to get just as much of a field. I put a formula field like:

shared numbervar custo_act;
custo_act:=0;
if {ITMCOST.ITCSEQ_0}-Maximum ({ITMCOST.ITCSEQ_0},{ITMCOST.ITMREF_0})=0 then
custo_act :={ITMCOST.VLTTOT_0};

I intend to get the value of VLTTOT field taking into account the highest value of the field ITCSEQ, but sommetimes return "0".

can someone help me?

Luis
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 20 Dec 2013 at 5:09am
look at the data...
what if x-max(y) = -4, what then? according to your logic, it is 0...

what if the max value is 0? is it possible?

just some things to think about.
IP IP Logged
Redondo
Newbie
Newbie


Joined: 24 Oct 2013
Location: Portugal
Online Status: Offline
Posts: 9
Quote Redondo Replybullet Posted: 20 Dec 2013 at 6:32am
Thanks for the opinion.
the value of ITCSEQ is always positive. therefore can never be zero. and is always in ascending sequence, I just want the máximum.
Luis
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Dec 2013 at 7:38am
ok, thanks.

the 'standard' way that I debug a formula is to break it into 'helper' formulas, like:
formula1:
{ITMCOST.ITCSEQ_0}

formula 2:
Maximum ({ITMCOST.ITCSEQ_0},{ITMCOST.ITMREF_0})

formula 3:
{ITMCOST.VLTTOT_0};

formula 4:
shared numbervar custo_act;

I would put them all on the same line...maybe formula 4 would go a line below the rest, just to make sure it is getting set.

All of the is should allow you to determine if you report is working the way you think it is

HTH
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