The Add/Edit Formulas tool is where formulas are created and stored. These formulas can be used within the Formula Rx tool to create nutrient recommendations, product prescriptions, and many other calculated layers. The video and article below show how to operate the tool and cover formula writing basics.
TABLE OF CONTENTS
Navigation/Operation
Navigation
Access the Add/Edit Formulas tool by clicking the 'Add/Edit Formulas' button in the Right-Click Menu in View, or by clicking 'Edit Formulas' in the Formula Rx tool.
Begin by selecting a Dealer. If necessary, formulas can be stored at the Grower level. You may want to store specific or unique formulas at the Grower level so that they can only be accessed for/by that Grower. If you do not want to view, add, edit, or delete formulas at the Grower level, then leave the Grower dropdown set to 'ALL'.
-Note: If formulas are stored at the Grower level and if that Grower is linked to an organization within John Deere Operations Center™, the ability to select product names from the product list in Operations Center™ is available. To learn more, click HERE.
To add a new formula from scratch, click the '+' button. The new formula will be added to the selected Dealer and Grower, if specified.
Formulas can be exported and imported as .json files. More on this below.
Open a formula by expanding the group and selecting it from the list.
To manipulate the formula, click 'Edit'.
To delete the formula, click 'Delete'.
-Note: If a formula is accidentally deleted, it cannot be restored.
Importing & Exporting
Formulas can be exported and imported as files. This can be useful for creating multiple versions of formulas, moving formulas between Dealers and Growers, or saving a backup of your formulas.
Export:
To export formulas, click the export button (cloud with down arrow).
Select the formulas you would like to export.
All formulas can be selected or deselected.
Click 'Export'.
Import:
To import formulas, click the import button (cloud with up arrow).
Import the file by dragging and dropping to the box or by clicking 'Choose File' and selecting from your local files.
Select the formulas that you would like to import.
All formulas can be selected or deselected.
Confirm the info of the selected formula(s) under the 'Formula Content' box.
Click 'Import'.
"Details" Box
Under the Details box of the Add/Edit Formulas tool, formulas are named, grouped, and important specifications are set that determine how the output layer is created and stored.
Formula Name - Required and fully customizable.
Group Name - Not required and fully customizable. Formula Groups are selected in the Formula Rx tool. Formulas saved under different groups can not be selected at the same time, but formulas saved under the same group can. To create a new group, simply type the new group name in the line.
Layer Type & Product name - Required. Specifies the output layer of the formula. When an "Rx" layer type is selected, this assumes the formula is generating a product recommendation, and the 'Product name' line is made available. Other layer types, including nutrient recommendations, can be selected. In this case, a product conversion can be applied after the fact. More info on this process is contained below.
Unit - Specifies the units of the output layer. This also sets the units for the values entered under the Preferences box and in the Formula Rx tool. The list of available units in the dropdown is dependent on the selected layer type.
Auto Type & Auto Cell Size - If selected, the formula will automatically run as soon as new layers and/or datasets contained within the formula are available. If the 'Layers' option is selected, the formula will run automatically when new versions of all the layer types specified within the formula Expression or Components are available. If the 'Samples (Dataset)' option is selected, the formula will automatically run for each individual sample point within a new soil dataset, and each point will have an associated layer. If Auto Type is selected, the resolution or cell size of the resulting layers can be specified in meters or feet. This only applied to auto-generated layers. The cell size for manually generated layers is set within the Formula Rx tool.
"Preferences" Box
In the Preferences box, default rates and parameters can be set for the output layer. These can be viewed and adjusted within the Formula Rx tool.
Min - Sets the "floor" of the calculated rates so that any calculated value below the entered Min will be rounded up to that number.
Switch Rate - The switch rate operates as follows: any rate equal to or below the value entered under Rate 1 will be rounded down to 0, any rate between the values entered under Rate 1 and Rate 2 will be rounded up to the value entered in Rate 2, and so on for Rate 3 and Rate 4. Only Rate 1 and Rate 2 are required when using a Switch Rate. The same value can be entered in both Rate 1 and Rate 2 so that any rate below that value will be rounded down to 0, and any rate above that value will be the calculated rate. Switch rates appear under the 'Min' column in the Formula Rx tool and are separated by commas (ex., 50,100).
Max - Sets the "ceiling" of the calculated rates so that any calculated value above the entered Max will be rounded down to that number.
Split By Max - When selected, any rates that exceeded the entered Max value will be saved under a second layer. This second layer will be saved under the same day and month but in the following year.
Split By % - Divides the calculated rates by the entered percentages (values must equal 100) into separate layers. Each layer will be saved on the same day and month under subsequent years.
Fill with Zeros - Pertains to credit layers used in the Formula Rx tool. When checked, any blank areas of the credited layers will be filled with zeros so that the layer can be properly credited. This is useful when crediting manure applications.
Cost $ - Cost per unit.
Also Run Formula - Will automatically run the selected formula when this formula is run.
Formula Basics
"Expression" Tab
Syntax
Under the Expression tab, the formula itself is stored ('Specification'), and the 'Variables & Units' are configured. Formulas in PCT Agcloud follow a simple, spreadsheet-style syntax that combines field data (soil tests, yield maps, etc.) with mathematical and logical expressions to calculate output layers. These output layers are most commonly fertilizer or seeding prescriptions, although other layers are available. The formula syntax, or the correct structure and arrangement of the components within the formula, is explained below.
Formula Components:
Brackets to reference stored layers (ex., [Soil P Mehlich 3]) or user-entered variables (ex., [Target pH]).
Mathematical operators to perform simple mathematical functions (ex.
+
,-
,*
,/, <, >).
Functions to perform more complex mathematical functions (ex.,
Min, Abs, Log
).
Parentheses to control order of operations.
Formula Structure:
Formulas can be as short, long, simple, or complex as necessary. Below are two example formulas that utilize the components listed above and structure them correctly.
Removal/Replacement Example:
To create an N Removal layer from a Wheat Yield layer using a removal rate of 1.5 lbs/ac, the following formula could be used:
[Yield, Wheat] * 1.5.
Taking this example a step further, a product conversion factor could be applied and the layer type changed to Rx Solid to create a nutrient replacement prescription. Using Urea (46-0-0) as an example, "[Yield, Wheat] * 1.5 / .46" would not just calculate the N removed by the crop but create a prescription in pounds of Urea to replace the N removed. Product conversions will be covered in more detail below.
"if" Statement Example:
The following example uses two connected "if" statements and a soil layer to create a nutrient recommendation in lbs/ac of P.
if([Soil P Mehlich 3] < 15, 80, if([Soil P Mehlich 3] < 25, 60, 40))
This example utilizes the most common formula format, which is the "if(condition, outcome, outcome)" format. The best way to understand the syntax of this formula is to write it out in plain language, specifically in reference to the commas.
if([Soil P Mehlich 3] < 15, 80,
First comma: If soil phosphorus is less than 15 (condition), then apply 80 lbs/ac (outcome).
Second comma: If soil phosphorus is not less than 15 (condition), then move on to the next if statement (outcome).
if([Soil P Mehlich 3] < 25, 60, 40))
Third comma: If soil phosphorus is less than 25 but greater than 15 (condition), then apply 60 lbs/ac (outcome).
Fourth comma: If soil phosphorus is neither less than 15 nor less than 25 (condition), then apply 40 lbs/ac (outcome).
-Note: When writing formulas, the first letter of all logical functions should be capitalized (ex., Min, Abs, Log) except for "if".
"Specification" Box
In the Specification box, formulas are stored and are able to be edited and copied. Below are various functions contained within the Specification box.
Layers
Click the 'Layers' button to view the full list of available layer types within PCT Agcloud. Layers can be added by typing them within brackets in the formula box or by selecting them from the list.
Crops
Click the 'Crops' button to view the full list of available crop names within PCT Agcloud. Certain layer types, such as Yield, can have a crop component added to them to further specify the layer. This is done by entering the layer name followed by a comma and the crop name (ex., [Yield, Corn]).
Operators
Click the 'Operators' button to view a list of common functions that can be used within formulas. This is not a comprehensive list of all available functions.
Copy
The 'Copy' button copies the formula code in .json format to the clipboard so that it can be pasted into Agworld's ExpressRx tool. If you want to simply copy the formula text itself, just select the text; do not use the 'Copy' button.
Enlarge/Shrink
Click the 'Enlarge/Shrink' button to view the Specification and Variables & Units boxes on top of one another. Click it again to return to the side-by-side view.
"Variables & Units" Box
The Variables & Units box is where Layers, Variables, Units, Crops, Products, and Values are listed and manipulated. This is also where formulas can be tested.
Layers - Text entered within brackets that match a standard layer name will be listed as a "Layer" within the Variables & Units box.
Crops/Products - Some layers can be further specified by adding a crop or product.
Variables - Text entered within brackets that do not match a standard layer name will be listed as a "Variable" within the Variables & Units box. Default values can be entered for the variables, and they can be edited within the Formula Rx tool.
Units - For some layer types, units must be specified. The layer name and corresponding unit must match those of the stored layer, which is meant to be referenced by the formula.
Testing - The testing function within the Variables & Units box is useful for confirming the operation and validity of the formula.
Yield Layers/Goals
The use of Yield layers within the Add/Edit Formulas tool has been partially covered in this article, but requires more clarification. When a Yield layer is entered within a formula, it references the "Field Selection" portion of the Formula Rx tool. This allows for flexibility when it comes to configuring yield goals. This flexibility allows you to choose between various yield goal types, values, seasons/layers, and lets you configure each field individually. More info on this functionality is contained within the Formula Rx tool article.
Setting Up Fertilizer Products
There are two ways to set up fertilizer products within the Add/Edit Formulas tool. One allows for product conversions to be included within the formula itself. The other option allows you to set up products independently in the "Components" tab that are then applied to a nutrient recommendation layer. The steps of each method are outlined below.
-Note: The examples below utilize solid fertilizer products. If you want to make a conversion to a liquid fertilizer product, be sure to confirm that your units and percentages are correct.
Including Product Conversions in Formulas
Product conversions can be added directly into formulas in the "Specification" box. To do this, simply divide by the nutrient percentage at the end of the formula. This option removes the extra step of first creating a nutrient rec layer and then applying a product to create an Rx layer.
"Components" tab
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article