Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way with the ABS() to show % of the differenc
Message
From
03/11/2000 10:09:05
Mike Mattos
Nationwide Computers
Mississauga, Ontario, Canada
 
 
To
02/11/2000 17:37:00
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00437296
Message ID:
00437611
Views:
16
If I understand correctly you need something like

deltapercent= mypercentfunction(0ldvalue,newvalue, abval )

you also need business rules, is an increase in a debt to be reported as an increase, or a decrease? so a third parameter, abval can be passed


FUNCTION mypercentfunction
lparameter Oldvalue, newvalue, abval

IF oldvalue = newvalue
return 0
endif

IF oldval=0 .and. abval
return 100
endif
IF oldval = 0 .and abval < 0
return -100
endif
IF abval
delta=(abs(oldval)*100 - abs(newval))*100 )/abs(oldval
* multiply by 100 first to increase accuracy of rounding !
return delta
endif



you probably need to add soem more conditions , too !

not an easy task, given how math challenged most clients are !
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform