HomeDocsAPI Reference
Kumo.ai
Docs

LAST

LAST(<table>.<column>, <start>, <end>)

Description

Calculates the most recent value within the specified time range in the specified <table>.<column> column starting from <start> days to <end> days. When used in the target field, the time period should be positive (in the future). When used in a temporal filter field, the time period should be negative (in the past).

This operator can be applied to any columns except foreign key columns.

Example

LAST(LOAN.AMOUNT, 0, 30)

Training Considerations

  • Kumo runs your pQuery over many historic slices of data and across all entities that meet your filter criteria to generate training examples.
  • If for a given entity and historic data slice there are no fact rows to aggregate over, this training example will be dropped. Thus, the operator makes the implicit assumption that for every entity a prediction is generated for, the user is assuming that the entity has at least one fact row in the prediction horizon.