-
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
[FIX] pivot: apply format on measure only a basic formula #5299
Conversation
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.
👋
src/plugins/ui_feature/format.ts
Outdated
if (!cell?.isFormula) { | ||
return true; | ||
} |
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.
"If the cell is not a formula, the cell is a basic pivot value formula" ?
src/plugins/ui_feature/format.ts
Outdated
@@ -43,7 +46,7 @@ export class FormatPlugin extends UIPlugin { | |||
for (let row = zone.top; row <= zone.bottom; row++) { | |||
const position = { sheetId, col, row }; | |||
const pivotCell = this.getters.getPivotCellFromPosition(position); | |||
if (pivotCell.type === "VALUE") { | |||
if (this.isBasicPivotValueFormula(position, pivotCell)) { |
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.
TBH I would just disable the functionnality on non spreaded pivot formula. It doens't make much sense for splitted formulas to me and sounds very much like black magic that people will not really understand.
I don't expect changing the format on a single =PIVOT.VALUE cell that I put alone on a random sheet to affect the format of the whole pivot on all the other sheet. The point of having splitted pivot is that I can do things on it independantly from the pivot no ?
989a17a
to
d7b4868
Compare
Let's say I have a computed measure "weighted_delay:sum", on which I applied an integer format. I later use it in a formula such as: =PIVOT.VALUE(1,"weighted_delay:sum","#user_id",A3)/PIVOT.VALUE(1,"__count:sum","#user_id",A3) This is no longer an integer. If I change the format on this formula ☝️, the format is applied on the entire measure, which is not what I want. With this commit, we apply the format on the measure (rather than on the cell) if and only if the value comes from a spilled PIVOT formula. Task: 4377411
d7b4868
to
68eb4c6
Compare
@robodoo r+ |
Description:
Let's say I have a computed measure "weighted delay:sum", on which I applied an integer format.
I later use it in a formula such as:
=PIVOT.VALUE(1,"weighted delay:sum","#user_id",A3)/PIVOT.VALUE(1,"__count:sum","#user_id",A3)
This is no longer an integer. If I change the format on this formula ☝️, the format is applied on the entire measure, which is not what I want.
With this commit, we apply the format on the measure (rather than on the cell)
if and only if the value comes from a spilled PIVOT formula.
Task: 4377411
review checklist