Scripting

Math Functions

The ABC function is a Pareto principal-based approach for classifying inventory items based on the consumption values of the items, aiming to identify the items with the top 80% contribution to your business. The ABC function in Easy Insight uses the following format:

abc([Metric], .8, .95, 1)

For this script, you'd want to use a custom grouping. Metric is the metric you're using to group the data (for example, Sales Quantity). The three numbers are what define the A, B, and C classifications. In this case, the .8 is defining the top 80% as A, the .95 is defining the next 15% as B, and the 1 is defining the remaining 5% as C.

The ceil function rounds the specific number up to the nearest whole number:

ceil([Metric]) where Metric has a value of 1.6 would give you 2.

The floor function rounds the specific number down to the nearest whole number:

ceil([Metric]) where Metric has a value of 1.6 would give you 1.

quartile returns the quartile of the selected value relative to all other values of the field in the report.

quartile([Customer], [Metric]")

would calculate the quartile for Metric for each unique value of Customer in the report.

The round function rounds the specific number to the nearest whole number:

ceil([Metric]) where Metric has a value of 1.6 would give you 2, while 1.3 would give you 1.

stddev returns the standard deviation of the field.

stddev([SalesPerson], [Metric])

would calculate the standard deviation of Metric for each distinct SalesPerson in the data. By itself, this script may not give you quite what you need, since Metric might already be summarized per SalesPerson by the time the calculation is evaluated. In order to make sure it runs correctly, you might instead want to try:

notnull([Sales ID], stddev([SalesPerson], [Metric]))

The above script makes sure that data is still broken out per sales ID when it calculates standard deviation, ensuring that the calculation is properly at the row level.

If you want to see the standard deviation for your entire data set, you can also simply do:

notnull([Sales ID], stddev([Metric])

sum returns the sum of Metric for all rows in the report.

sum([[Metric])

would calculate the sum for Metric across all rows in the report.

sum([[Metric], [Region])

would calculate the sum for Metric per unique Region in the data.