Calculations in a Sales Template

Statements can contain all sorts of lines of data surplus to your reporting needs. “Totals” lines for units or revenue, or odd lines detailing balance transfers. In other instances the data may contain a Gross Amount & Distribution Fee but no Net Amount. Rules can be set to omit lines of data depending on certain conditions, run sums to generate required missing values, or concatenate data fields. Our goal is that with carefully programmed templates utilising appropriate necessary rules you should not need to make manual changes to your sales files prior to uploading. These ‘rules’ are the Calculations.

On your sales template, open the Calculation tab and click + Calculation. Use Conditions to decide when the rule runs and Calculation & Output to define what the rule does and where to store the result. Use Notes to record why you added the rule. The GIF below shows how to derive Gross Amount when the file provides only Net Amount after a 10% commission. The formula is Gross Amount = Net Amount / 0.9.

The order of rules on the Calculation tab matters when one calculation uses the result of another.

Conditions

Here you specify under which condition the following calculation should happen. You have three options.

Any One Of The Below – The calculation will happen when at least one condition in a list of conditions is met.

All Of The Below – The calculation will only happen when all of the conditions are met.

Always – The calculation will always happen. To put it in other words, there is no condition.

In the below example, we have selected “Any One Of The Below”, meaning our calculation will happen when either Column 1 or Column 2 of a particular sales line is empty. Had we selected “All Of The Below”, our calculation would only happen when both Column 1 & Column 2 were empty.

Calculation & Output

Calculations can combine values from fields, columns or fixed inputs. Use Calculate After Mapping when the rule needs values produced by mapping. Leave it clear for a rule that needs to prepare a value for mapping. The following fields define the calculation:

Output Field – This decides the field in which the result of your calculation will be stored. One special option is the “Skip Row”, which allows you to skip an entire row entirely.

Value Type / Value – Here you decide which Values should be part of the Calculation. As input of the calculation you can pick either a column, field or value. “Column” takes the starting value from a column in the sales file. You then direct to which column in the subsequent Value table by entering a number, counting the columns in the data from left to right. “Field” takes the starting value from a field matched in the sales file. So when selecting this the subsequent Value box is populated with the various Field names that are matched to columns on the template overview tab. Make sure the directed field actually contains some data & is linked to a column when setting up the template. With “Value” as a Value Type, you enter a number or text that will be used in the calculation.

Calculation – Choose Plus, Minus, Multiplied By, Divided By, Get First X Number of Characters, Get Last X Number of Characters or Concatenate.

Let’s look at some examples of how to create calculation outputs.

Plus/Minus/Multiply/Divide

The screenshot below starts with Gross Amount and deducts a 10% commission. Its formula is Net Amount = Gross Amount * 0.9. Map the gross amount column on the template so the rule can use it as an input for each sales line.

Additions, subtractions & divisions are done in the same way. It is possible to perform a series of calculations by adding a new calculation layer; just hit the  + Output Calculation button. The system will make the calculations in the order they are added.

Get X Numbers of Characters

This function trims the data to the first or last specified number of characters. The following example will take the first 10 characters of Column 5 & store it as the Barcode. if Column 5 holds the value  7856957595 GTIN, Curve will store 7856957595 as the Barcode of your sales line.

Concatenate

The Concatenate function combines data from different columns into one. This is typically used to combine text data. The following example combines the data in Column 5 & Column 6 to store it as the Original Configuration.

If Column 5 contains Ad-Supported and Column 6 contains Stream, the calculation stores Ad-SupportedStream in Original Configuration. In the same template, use Mapping → Configuration Mapping to map that combined value to your preferred configuration.

Skip Row

The Skip Row functions allows you to tell Curve to ignore certain rows of data under specific conditions. A common use case scenario for this is a Total row at the bottom of your statement you wish to ignore. Or perhaps you prefer to leave out certain sales lines with a 0 Net Amount.

First, via the Conditions area, you will need to specify under which circumstances you wish Curve to ignore the sales line. In the Output Field, you then select the value Skip Row.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us