stevebull Posted June 28, 2012 Posted June 28, 2012 Hi Everyone. I hope someone will be able to shed some light on this one for me. I currently have a calculation set up to provide a numerical value. The equation is below. If(GetAsNumber(%) =""; Total Amount applied per day; Extend (Total Amount applied per day) * Extend (Retention factor)*%*1000/6000) I would now like to include an addition to this such that it will take into account a percentage 1-100% that will be included in an additional field so that it looks something like this. If(GetAsNumber(%) =""; Total Amount applied per day; Extend (Total Amount applied per day) * Extend (Retention factor)*%* NEWPERCENTAGE *1000/6000), where NEW percentage will, by default always be 100%, unless the field 'NEW PERCENTAGE' contains a manually added value between 0-100%. How could I do this without needing to manually add "100%" in the "new percentage" field each time I do not have a specific value to add i.e when I leave it blank. Thanks guys
comment Posted June 28, 2012 Posted June 28, 2012 Try something like = Let ( [ p = Case ( IsEmpty ( NewPercentage ) ; 100 ; NewPercentage ) ] ; something * p )
stevebull Posted July 3, 2012 Author Posted July 3, 2012 Thanks for this At the moment it is set up as below. SED = If(GetAsNumber(%) =""; Total Amount applied per day; Extend (Total Amount applied per day) * Extend (Retention factor)*%*1000/6000) The number for "NEWPERCENTAGE" is pulled across from another database thus I cannot add this script as a calculation when it i set up to pull the value across, so do I need to create an additional field to link it. I am am amateur so any help would need to be for the IQ of a bin bag! , The other question is what is "p"?
Vaughan Posted July 3, 2012 Posted July 3, 2012 Use IsEmpty() not ="". Is % a field? If so, change the name to something else. It will cause grief in the future.
comment Posted July 3, 2012 Posted July 3, 2012 The number for "NEWPERCENTAGE" is pulled across from another database thus I cannot add this script as a calculation when it i set up to pull the value across, so do I need to create an additional field to link it. I am afraid I don't follow your description. Perhaps you should tell us more about what this is about. Why are you using Extend() - is this a repeating field calculation? That's probably not a good idea. The other question is what is "p"? p is the name of a variable I have defined for the purposes of the calculation. See the help on the Let() function for more. Is % a field? If so, change the name to something else. It will cause grief in the future. What grief?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now