lgdelta
  • 1 Minute to read
  • Dark
    Light
  • PDF

lgdelta

  • Dark
    Light
  • PDF

Article summary

Returns the difference between the natural logarithm for the current row and the natural logarithm for the previous row

Purpose

Use this function to: 

  • Calculate the change in logarithm

Calculation

  1. Calculates the natural log for each row (log)
  2. Calculates the difference between the logs (lgdelta)

lgdelta= log(RowX) - log(Row(X-1))

RowX = value for current row
Row(X+1) = value for next row 
log(RowX) = natural log for current row
log(Row(X-1)= natural log for previous row

Sample Result

 

Parameters

Parameter`Description
DimensionsDiscrete field(s).    All fields must come from the same table.
NameName to be displayed as Column Header in result grid
MeasureThe field to be used in the post-function calculation.
  • Must be numeric if Function is anything other than COUNT.
  • Must come from same table as DIMENSIONS.
  • Supports Discrete or Continuous DataTypes.
FunctionCOUNT / SUM / AVG / MIN / MAX / STDEV
Postlgdelta
ValueOptional.   Filter to apply when evaluating FUNCTION.   Only records in the Filter Recordset will be included in the Function and Post-Function calculations.
Must come from same table as DIMENSION/MEASURE or be linked to the Dimension table.
Axis0 / 1.    Y-Axis to use when plotting graph.     Default = 0
PlotY / N.   Specifies whether measure’s output column should be plotted on graph.  Default = Y
ResolveOptional.   Resolve level for the measure.   If blank, Resolve = Dimension Table
Series TypeDefault / Bar / Stacked Bar / Line / Spline / RangeLow / RangeHigh / CSLow / CSHigh / CSOpen / CSClose
Determines the graph style for the measure.
PopupDefault / None / Extended
Prefix$ / £ / E / %

Usage Notes

See log  for details on calculating natural logarithms.

Example

NOTE: Measures 1 and 2 are included purely for illustration. It is not necessary to include these measures for the calculation to work.


Dimension (s):  [transactions].[product_group], [transactions].[yearmonth]

Measure 1

  • Name: = Count
  • Measure:  = transactions.cid
  • Function: = count
  • Post: =
  • Value: =
  • Axis: =0
  • Plot:= N
  • Resolve:=
  • Series Type:=Default
  • Popup:=Default
  • Prefix:=


Measure 2

  • Name: = Log
  • Measure:  = transactions.cid
  • Function: = count
  • Post: =log
  • Value: =
  • Axis: =0
  • Plot:=Y
  • Resolve:=
  • Series Type:=Default
  • Popup:=Default
  • Prefix:=


Measure 3

  • Name: = lgdelta
  • Measure:  = transactions.cid
  • Function: = count
  • Post: =lgdelta
  • Value: =
  • Axis: =0
  • Plot:=Y
  • Resolve:=
  • Series Type:=Default
  • Popup:=Default
  • Prefix:=


Example use: Using lgdelta to calculate the difference in log values




Was this article helpful?

What's Next