fix: correct weightCol for percentage change aggregations in DataTable docs#3279
Open
wrathagom wants to merge 1 commit intoevidence-dev:mainfrom
Open
fix: correct weightCol for percentage change aggregations in DataTable docs#3279wrathagom wants to merge 1 commit intoevidence-dev:mainfrom
wrathagom wants to merge 1 commit intoevidence-dev:mainfrom
Conversation
…e docs - Update example-project total-rows page to use prev_* columns as weightCol for percentage change columns (sales_change_pct0, num_orders_change_pct0, aov_change_pct0) - Add tip in DataTable documentation explaining that weightCol should be the baseline/previous value when aggregating percentage changes Co-Authored-By: Caleb Keller <calebmkeller@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
re: #2592
Fixes incorrect
weightColvalues in DataTable documentation examples for percentage change aggregations.When using
totalAgg=weightedMeanfor percentage change columns, theweightColshould reference the baseline/previous value column, not the current value. This is because percentage changes are calculated relative to the original value (e.g.,(new - old) / old).Changes:
Example project fix (
sites/example-project/src/pages/tables/total-rows/+page.md):sales_change_pct0: weightCol=sales_usd0k → weightCol=prev_sales_usd0knum_orders_change_pct0: weightCol=sales_usd0k → weightCol=prev_num_orders_num0aov_change_pct0: weightCol=sales_usd0k → weightCol=prev_aov_usd2Documentation tip (
sites/docs/pages/components/data/data-table/index.md):weightColfor percentage change aggregationsChecklist