Customized

<< Click to Display Table of Contents >>

Current:  Create Dashboard > Table > Visual Analysis > Dynamic Calculator 

Customized

Previous pageReturn to chapter overviewNext page

In the dynamic calculation dialog , select the customized option in the calculate.

dynamic34

After selecting Custom, open the script dialog. As shown in the following figure, there are dynamic calculator-related functions in the public:

dynamic35

[Name]The name of the data segment as a dynamic calculator script.

When the user uses the script for dynamic calculation, click the OK button to enter the dynamic calculation dialog again. In this box, the user can set the dynamic calculation direction by the direction option. When the user needs to edit the expression again, click the edit button, then the expression can be edited again. As shown below:

dynamic36

[Secondary]That is, there are other scripts in the current expression that dynamically evaluate the data segment name. If there is already a script dynamic calculation data segment, the name is movingAVG, when the user uses again in the current expression, movingAVG data segment belongs to the second script dynamic calculation, such as the expression movingMin(col['movingAVG'] ,2,2,true,true); The user needs to check the secondary calculation option.

 

The product provides 15 dynamic computing functions as shown in the table below.

Dynamic computing function

Description

Example

diff(Object expression, [int position])

Returns the difference between two values.

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

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

//If current value or the previous value is null, return to null.

percentDiff(Object expression, [int position])

Returns the difference between two values in percent.

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

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

//If current value or the previous value is null or zero, return to null.

percent(Object expression, [int position])

Returns each value as a percentage of another specified value.

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

//Calculate the percentage of current value and the previous value of sales field.

//If current value or the previous value is null or zero, return to null.

percentSum(Object expression)

Percentage of current value and sum total.

percentSum(col['sales']);

//Current value divided by the total sum

percentMax(Object expression)

Percentage of current value and the maximum value.

percentMax(col['sales']);

//Current value divided by the total maximum value

percentMin(Object expression)

Percentage of current value and the minimum value.

percentMin(col['sales']);

//Current value divided by the total minimum value.

percentAvg(Object expression)

Percentage of current value and the total average value

percentAvg(col['sales']);

 //Current value divided by the total average value

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

Sum of the mobile computing returns the sum of the previous values to the next few values.

// prev previous values

//next next values

//cincluded include current value or not

//nappended If there is no sufficient value, whether it is null

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

//Given sales field. Take previous two and next two values. Add current value and sum value. No sufficient value takes null

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

Sum of the mobile computing average value, returns the sum of the previous values to the next few average values.

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

//Given sales field. Take previous two and next two values. Add current value and take the average value. No sufficient value takes null.

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

Mobile computing maximum. Return to the maximum value from the previous values to the next several values

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

//Given sales field. Take previous two and next two values. Add current value and take the maximum value. No sufficient value takes null.

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

Mobile computing minimum value. (Return to the minimum value from the previous values to the next several values) )

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

//Given sales field. Take previous two and next two values. Add current value and take the minimum value. No sufficient value takes null.

runningAvg(Object expression,[Object reset])

Cumulative computing of average value. Return from the first value to current value. Cumulative averaging   

//reset The field starting accumulation.

runningAvg(col['sales'] col['city']);

//Calculate the cumulative average of sales field. In case of grouping of city field, accumulate once more.

runningMin(Object expression,[Object reset])

Cumulative computing of the minimum value. Return from the first value to current value. Cumulative minimum value

runningMin(col['sales'] col['city']);

//Calculate the cumulative minimum value of sales field. In case of grouping of city field, accumulate once more.

runningMax(Object expression,[Object reset])

Cumulative computing of the maximum value. Return from the first value to current value. Cumulative maximum value

runningMax(col['sales'] col['city']);

//Calculate the cumulative maximum value of sales field. In case of grouping of city field, accumulate once more.

runningSum(Object expression,[Object reset])

Cumulative computing of the sum total. Return from the first value to current value. Cumulative sum total.

runningSum(col['sales'] col['city']);

//Calculate the cumulative sum total of sales field. In case of grouping of city field, accumulate once more.

When the component is in an aggregated state, the abbreviations of Sum, Avg, and other summary functions are added before the field when the field is referenced in the script.

 

For Example: The PROFIT field is bound in an aggregation table and summed up for this field, as shown in the following figure:

dynamic37

When the user needs to add dynamic calculations for the PROFIT field in the aggregation table, the script content is movingMax(sum(col['PROFIT']), 1, 1, true, true); that is, the maximum value of the mobile calculation, as shown in the following figure :

dynamic38

The result of the calculation is shown in the figure below:

dynamic39