| Author |
Message |
Redondo
Newbie
Joined: 24 Oct 2013
Location: Portugal
Online Status: Offline
Posts: 9
|

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 Logged |
|
|
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

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 Logged |
|
Redondo
Newbie
Joined: 24 Oct 2013
Location: Portugal
Online Status: Offline
Posts: 9
|

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 Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

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 Logged |
|
|
|