I'm using Crystal Reports 2013. I've created a formula with three variables which returns absolute values. I need the formula to return the level corresponding to the smallest absolute value.
WhilePrintingRecords;
Local NumberVar tenK := Abs (ToNumber({@AcctBal}) - 10000); //Level A
Local NumberVar fiftyK := Abs (ToNumber({@AcctBal}) - 50000); //Level B
Local NumberVar OnehundredK := Abs (ToNumber({@AcctBal}) - 100000); //Level C
For example if @AcctBal = 76K then tenK = 66K, fiftyK = 26K and OnehundredK = 24K
Therefore, I would want the formula to return Level C as this is the smallest absolute value.
If there is an easier way to return needed values instead of variables, please share.
Thanks,
D. Lee
WhilePrintingRecords;
Local NumberVar tenK := Abs (ToNumber({@AcctBal}) - 10000); //Level A
Local NumberVar fiftyK := Abs (ToNumber({@AcctBal}) - 50000); //Level B
Local NumberVar OnehundredK := Abs (ToNumber({@AcctBal}) - 100000); //Level C
For example if @AcctBal = 76K then tenK = 66K, fiftyK = 26K and OnehundredK = 24K
Therefore, I would want the formula to return Level C as this is the smallest absolute value.
If there is an easier way to return needed values instead of variables, please share.
Thanks,
D. Lee