Derived Columns
Derived Columns Mathematical Functions
Learn about a variety of mathematical functions available for creating derived columns, including operations like rounding, logarithmic calculations, trigonometric functions, and more. These functions allow for sophisticated data transformations in subscription and financial models, helping you derive meaningful insights from your datasets.
ABS (Absolute Value)
- Syntax:
abs(value)
- About: Calculates the absolute (positive) value of a number, discarding the sign.
- Example: If a Chargebee invoice has a negative adjustment value, you can use
abs(-150)
to ensure you’re working with positive values in calculations.
CEILING (Round Up)
- Syntax:
ceiling(value)
- About: Rounds a number up to the nearest integer or multiple of significance.
- Example: To estimate the ceiling value for the number of user licenses, use
ceiling(250.75)
to round up to the next whole number.
EXP (Exponential Function)
- Syntax:
exp(value)
- About: Calculates e (Euler’s number) raised to the power of a given number.
- Example: For exponential growth predictions of MRR,
exp(0.5)
might represent an increase factor.
FLOOR (Round Down)
- Syntax:
floor(value)
- About: Rounds a number down to the nearest integer or multiple of significance.
- Example: To calculate the maximum discount level on a Chargebee subscription, use
floor(discount_percentage)
to get a whole number.
LN (Natural Logarithm)
- Syntax:
ln(value)
- About: Computes the natural logarithm (base e) of a number.
- Example: To analyze the rate of growth of a subscription metric, apply
ln(MRR)
to the monthly recurring revenue.
LOG (Logarithm)
- Syntax:
log(value)
- About: Calculates the logarithm of a number to a specified base, commonly base 10.
- Example: To determine order of magnitude changes in usage statistics,
log(subscription_quantity)
can be applied.
MOD (Modulus)
- Syntax:
mod(value, divisor)
- About: Returns the remainder after division of one number by another.
- Example: Find the remainder of subscription months after dividing by 12 to calculate leftover months:
mod(total_months, 12)
.
POWER (Exponentiation)
- Syntax:
power(base, exponent)
- About: Raises a base number to the power of the exponent.
- Example: To calculate the power of growth over time, use
power(MRR, growth_factor)
.
RAND (Random Number)
- Syntax:
rand()
- About: Generates a random number between 0 and 1.
- Example: Randomly select a subset of users for a survey from Chargebee subscriptions by assigning
rand()
and picking the lowest values.
ROUND (Round to Decimals)
- Syntax:
round(value, num_decimals)
- About: Rounds a number to a specified number of decimal places.
- Example: To standardise financial reporting, round the MRR to two decimal places:
round(MRR, 2)
.
SQRT (Square Root)
- Syntax:
sqrt(value)
- About: Calculates the square root of a number.
SIN (Sine Function)
- Syntax:
sin(value)
- About: Returns the sine of a value (angle) in radians.
COS (Cosine Function)
- Syntax:
cos(value)
- About: Returns the cosine of a value (angle) in radians.
TAN (Tangent Function)
- Syntax:
tan(value)
- About: Returns the tangent of a value (angle) in radians.
TRUNC (Truncate)
- Syntax:
trunc(value)
- About: Truncates a number to an integer by removing the fractional part of the number.
- Example: To display only the integer part of a revenue figure, use
trunc(MRR)
.
SIGN (Sign Function)
- Syntax:
sign(value)
- About: Determines if a number is negative, zero, or positive by returning -1, 0, or 1 respectively.
- Example: To categorize change in MRR as increased, unchanged, or decreased,
sign(MRR_change)
could be used.
Was this page helpful?