# Reshuffling of columns is not resolved as per the ticket #164413

**URL:** <https://discuss.elastic.co/t/reshuffling-of-columns-is-not-resolved-as-per-the-ticket-164413/366977>\
**Category:** Kibana\
**Tags:** lens\
**Created:** [September 23, 2024, 3:50pm UTC](https://discuss.elastic.co/t/reshuffling-of-columns-is-not-resolved-as-per-the-ticket-164413/366977 "2024-09-23T15:50:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arshukla](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Arshukla](https://discuss.elastic.co/u/Arshukla)\
**Post date:** [September 23, 2024, 3:50pm UTC](https://discuss.elastic.co/t/reshuffling-of-columns-is-not-resolved-as-per-the-ticket-164413/366977/1 "2024-09-23T15:50:32Z")

</div>

Hello Team,

As per the below two pull and github the issue is marked resolved. However when I checked the same in v8.14 of Kibana. the issue is still there... Can you please explain what needs to be done, to avoid column reshuffling

> <https://github.com/elastic/kibana/issues/164413>
>
> \*\*Describe the feature:\*\*
> 
> When exporting a Lens table as CSV, the order of colu…mns visualized in the Lens table is not respected within the CSV file content.
> 
> \*\*Describe a specific use case for the feature:\*\*
> While the content is equivalent this could be annoying when the user has some script that rely on some order of the columns.

> <https://github.com/elastic/kibana/pull/174994>
>
> \## Summary
> 
> Fixes #160719, fixes #164413
> 
> This PR contains some work about L…ens datatable, here's a short list:
> 
> \* moved out the sorting logic of the datatable into an independent package: \`@kbn/sort-predicates\`
> \* leverage the EUI Datagrid \`schemaDetectors\` for the table rows sorting
> \* apply datatable columns sorting also to the CSV exporter
> 
> \### Checklist
> 
> \- \[x\] \[Unit or functional tests\](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [September 24, 2024, 7:10am UTC](https://discuss.elastic.co/t/reshuffling-of-columns-is-not-resolved-as-per-the-ticket-164413/366977/2 "2024-09-24T07:10:38Z")

</div>

Hi @Arshukla ,

can you post some steps to reproduce the issue?  
Are you using the `Split by` dimension in the datatable?

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [September 24, 2024, 7:10am UTC](https://discuss.elastic.co/t/reshuffling-of-columns-is-not-resolved-as-per-the-ticket-164413/366977/3 "2024-09-24T07:10:48Z")

</div>

Added #lens

---

<div class="post-metadata">

**Author:** ![Arshukla](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Arshukla](https://discuss.elastic.co/u/Arshukla)\
**Post date:** [September 24, 2024, 8:25am UTC](https://discuss.elastic.co/t/reshuffling-of-columns-is-not-resolved-as-per-the-ticket-164413/366977/4 "2024-09-24T08:25:40Z")

</div>

Hi @Marco_Liberati ,  
Thanks for your response.

I’ve created a tabular dashboard using specific variables from an index, where all the variables are placed under "Rows" and "Metrics." None of the variables are added in the "Split By" dimension.

However, when I download the data as a CSV by clicking on the three dots in the top-right corner of the panel and selecting "Download as CSV," the columns get reshuffled. For example, column 1 moves to column 8, and column 6 shifts to column 1, causing the entire dataset to be misaligned.

---

<div class="post-metadata">

**Author:** ![Arshukla](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Arshukla](https://discuss.elastic.co/u/Arshukla)\
**Post date:** [September 26, 2024, 12:12pm UTC](https://discuss.elastic.co/t/reshuffling-of-columns-is-not-resolved-as-per-the-ticket-164413/366977/5 "2024-09-26T12:12:39Z")

</div>

Hello Team, Please revert
