Replies: 2 comments 3 replies
-
You can duplicate a column in Perspective by giving it an alias: viewer.restore({
columns: ["My Column", "My Column 2"],
expressions: {
"My Column 2": "\"My Column\""
}
}); We're going to add quick-duplicate action buttons to the columns settings bar at some point, but they will just perform this action. (Moving to discussions) |
Beta Was this translation helpful? Give feedback.
-
Holding the Perspective internally uses column name string itself as the unique column identifier, so we cannot physically have duplicate column names, even as expression aliases. The impact of this design decision trickles all the way down to e.g. the persistence and internal wire formats, and would be a major breaking change. Additionally, this is a feature breaking change in that many Perspective-based systems are designed around the contract of a viewer config JSON that works when the row data changes. As most data formats (even Arrow) are not structured with aliases in mind, Perspective cannot deterministically rehydrate a Viewer config for a dataset if there are duplicate column names because it can't tell which columns go with which config aliases. Like I said, we have some UX features in the works to make this a little quicker, and it is (I think) possible to make this design mostly transparent - we can duplicate the column implicitly when you drag/drop to a "duplicate" slot e.g., but this requires some careful consideration of the drag/drop rules. |
Beta Was this translation helpful? Give feedback.
-
Feature Request
Description of Problem:
Currently when doing aggregate functions, I can't compare different aggregate functions on the same column such as mean and median.
Potential Solutions:
This would be remedied if I could add the same column to the
Y Axis
selection multiple times.For example, using this data of student exams, I want to group by
exam_subject
and create a bar chart showingavg
andmedian
exam_score
in each group. Once I selectexam_score
once, though, I can't select it again.Beta Was this translation helpful? Give feedback.
All reactions