Skip to content

Commit

Permalink
Apply time shift period filter after counting whole expression (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianmroz-allegro committed Apr 22, 2021
1 parent a6d232b commit e83afb7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/common/models/series/concrete-series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ export abstract class ConcreteSeries<T extends Series = Series> {
case TimeShiftEnvType.WITH_PREVIOUS: {
const currentName = this.plywoodKey();
const previousName = this.plywoodKey(SeriesDerivation.PREVIOUS);
const current = this.applyExpression(this.filterMainRefs(expression, timeShiftEnv.currentFilter), currentName, nestingLevel);
const previous = this.applyExpression(this.filterMainRefs(expression, timeShiftEnv.previousFilter), previousName, nestingLevel);
const current = this.filterMainRefs(
this.applyExpression(expression, currentName, nestingLevel),
timeShiftEnv.currentFilter);
const previous = this.filterMainRefs(
this.applyExpression(expression, previousName, nestingLevel),
timeShiftEnv.previousFilter);
const delta = new ApplyExpression({
name: this.plywoodKey(SeriesDerivation.DELTA),
expression: $(currentName).subtract($(previousName))
Expand Down

0 comments on commit e83afb7

Please sign in to comment.