Hi, we use a pivot table object import { PivotTab...
# gooddata-ui
m
Hi, we use a pivot table object import { PivotTable } from “@gooddata/sdk-ui-pivot”; to export data to csv/xslx. Is it possible to order the columns in the table? We need to export in a precise order as the data is used downstream for import.
i
Hi Michael, unfortunately columns given by order of column attribute’s elements cannot be sorted. Only order of multiple metrics in columns is given by order of metrics in execution definition
j
@Ivan Nejezchleb would it be possible to work around the PivotTable component in this case? Could you defined a custom payload (metrics, attributes) with custom resultSpec (dimensions, sorting) and then call the API to export the result?
i
if there is Column attribute which slices metric to multiple columns by its elements then we have no option how to sort these elements and thus the columns, as far as I know ;(
👍 1
m
Problem is that pivot table comes loaded with cool features and export is faster for a large data set. I have another table with useExecutionDataView with antd table but it’s super slow so I have to add a window param and can’t export everything. I’m considering building a bridge outside of gooddata straight to postgres for this.
@Ivan Nejezchleb In this export, it’s more a straight table than pivot. I’m not transposing row to column.
i
@Michael Serres but you use Column attribute, right? Or just row attributes and some metrics? How your table buckets look in AD?
m
Yes, we can always use columns, for now only using rows and metrics. Will need American football gear to get passed client that rows go first then metrics… @Ivan Nejezchleb
i
in this case order of columns in such table should be: c1: elements of first row attribute c2: elements of second row attribute … m1: column with values of first metric m2: column with values of second metric … And this order of columns is given by order of items in each bucket and can not be changed