-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] pivot: add support for date(time) measures #5302
base: master
Are you sure you want to change the base?
Conversation
2b63f23
to
1929040
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tchou tchou 🚂
@@ -42,6 +42,7 @@ const AGGREGATORS_BY_FIELD_TYPE = { | |||
integer: NUMBER_CHAR_AGGREGATORS, | |||
char: NUMBER_CHAR_AGGREGATORS, | |||
boolean: ["count_distinct", "count", "bool_and", "bool_or"], | |||
datetime: ["max", "min", "count_distinct", "count"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can "average" aggregator make sense for dates in some cases ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't think of a use-case. But if you have an idea, we can add it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmmh if our Duration time format is included in this, both sum and average make sense.
Otherwise I'm not sure, but there'll probably be some Argentinan dude that might use it in his specific and niche use case. If it's free to add, why not add it 🤷
@@ -55,6 +55,6 @@ pivotRegistry.add("SPREADSHEET", { | |||
onIterationEndEvaluation: (pivot: SpreadsheetPivot) => pivot.markAsDirtyForEvaluation(), | |||
dateGranularities: [...dateGranularities], | |||
datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"], | |||
isMeasureCandidate: (field: PivotField) => !["datetime", "boolean"].includes(field.type), | |||
isMeasureCandidate: (field: PivotField) => field.type !== "boolean", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the next step also allowing boolean measures ? Or is there a specific reasons they don't work ?
And my next question: if we also allow boolean measures, do we want to enable drag & drop accros cols/row/measures ? With the special case of calculated measure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably yes and yes
{ id: "Date:max", fieldName: "Date", aggregator: "max" }, | ||
{ id: "Datetime:max", fieldName: "Datetime", aggregator: "max" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: could test differents aggregator rather than 2 max to be a bit more complete
With this commit, date and datetime fields are now supported as measures for pivots. Task: 3989393
1929040
to
6e7be0d
Compare
Task: 3989393
Description:
description of this task, what is implemented and why it is implemented that way.
Task: TASK_ID
review checklist