June 28, 201213 yr 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
June 28, 201213 yr Try something like = Let ( [ p = Case ( IsEmpty ( NewPercentage ) ; 100 ; NewPercentage ) ] ; something * p )
July 3, 201213 yr Author 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"?
July 3, 201213 yr Use IsEmpty() not ="". Is % a field? If so, change the name to something else. It will cause grief in the future.
July 3, 201213 yr 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?
Create an account or sign in to comment