Dynamic Calculator Script

<< Click to Display Table of Contents >>

Current:  Script > Yonghong Script Object Reference List 

Dynamic Calculator Script

Previous pageReturn to chapter overviewNext page

This product provides users with a richer dynamic calculation function, as shown in the following table.

Functions

Instructions

Examples

diff(Object expression, [int position])

Returns the difference between two specified values.

diff(col['sales'], PREVIOUS) ;

//Calculate the difference of the sales field, the difference between the current value and the previous value.

//If the current value or the previous value is empty, it returns null.

percentDiff(Object expression, [int position])

Returns the percentage difference between two specified values.

percentDiff (col['sales'], PREVIOUS);

// Calculate the percentage difference between the current value in the sales field and the previous value.

// Returns empty if the current value or the previous value is empty or zero.

percent(Object expression, [int position])

Returns the percentage of the specified value.

percent (col['sales'], PREVIOUS);

// Calculate the percentage of the current value in the sales field to the previous value.

// Returns empty if the current value or the previous value is empty or zero.

percentSum(Object expression)

The current value as a percentage of the sum.

percentSum(col['sales']);

// Current value divided by total sum value

percentMax(Object expression)

The percentage of the current value to the maximum value.

percentMax(col['sales']);

//The current value divided by the total maximum

percentMin(Object expression)

The percentage of the current value to the minimum value.

percentMin(col['sales']);

//The current value divided by the total minimum

percentAvg(Object expression)

The percentage value of the current value to the total average.

percentAvg(col['sales']);

//The current value divided by the total average

movingSum(Object expression,[ int prev, int next, boolean cincludedCurrent, boolean nappended])

The sum of the mobile calculations returns the sum from the first few values to the last few values

// The first few values of prev

//The next few values

//cincluded include current value

//nappended if there is not enough value, whether to take it empty.

movingSum(col['sales'], 2, 2, true, true); 

//For the sales field, take the first two and the last two of the current value, add the current value, and sum. Not enough value to take the air.

movingAvg(Object expression, [int prev, int next, boolean cincluded, boolean nappended])

Moves the average of the calculations and returns the average from the first few values to the last few values

movingAvg(col['sales'], 2, 2, true, true);

//To the sales field, take the first two and the last two of the current value, add the current value, and average. Not enough value to take the air.

movingMax(Object expression, [int prev, int next, boolean cincluded,    boolean nappended])

Moves the maximum value and returns the maximum value from the first few values to the last few values

movingMax(col['sales'], 2, 2, true, true); 

//For the sales field, take the first two and the last two of the current value, add the current value, and find the maximum value. Not enough value to take the air.

movingMin(Object expression,[ int prev, int next, boolean cincluded, boolean nappended])

Move the minimum value. (returns the minimum value from the previous value to the last value)

movingMin(col['sales'], 2, 2, true, true); 

//For the sales field, take the first two and the last two of the current value, add the current value, and find the minimum value. Not enough value to take the air.

runningAvg(Object expression,[Object reset])

Cumulative calculation of the average, returning from the first value to the current value, cumulative averaging

//reset is from which field to start accumulating.

runningAvg(col.sales,col.city);

//Calculate the cumulative average of the sales field. The group in the city field is encountered and accumulated again.

runningMin(Object expression,[Object reset])

Cumulative calculation of the minimum value, return from the first value, to the current value, the cumulative minimum value)

runningMin(col.product, col.city);

//Calculate the cumulative minimum value of the sales field. The group in the city field is encountered and accumulated again.

runningMax(Object expression,[Object reset])

Cumulative calculation of the maximum, return from the first value to the current value, cumulative maximum

runningMax(col.product, col.city);

//Calculate the cumulative maximum value of the sales field. The group in the city field is encountered and accumulated again.

runningSum(Object expression,[Object reset])

Cumulative calculation sum, returning from the first value to the current value, cumulative summation)

runningSum(col.product, col.city);

//Calculate the cumulative sum of the sales field. The group in the city field is encountered and accumulated again.