Skip to content

Commit

Permalink
TimeAttribute is attribute name so use it to find dimension first and…
Browse files Browse the repository at this point in the history
… then use dimension reference in fresh default filter
  • Loading branch information
adrianmroz-allegro committed Jan 31, 2022
1 parent 188915b commit f579025
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/models/data-cube/data-cube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,11 @@ export function getTimeDimensionReference(dataCube: ClientDataCube): string {
export function getDefaultFilter(dataCube: ClientDataCube): Filter {
const filter = dataCube.defaultFilter || DEFAULT_DEFAULT_FILTER;
if (!dataCube.timeAttribute) return filter;
const timeDimensionReference = getTimeDimensionReference(dataCube);
return filter.insertByIndex(0, new RelativeTimeFilterClause({
period: TimeFilterPeriod.LATEST,
duration: dataCube.defaultDuration,
reference: dataCube.timeAttribute
reference: timeDimensionReference
}));
}

Expand Down

0 comments on commit f579025

Please sign in to comment.