This is the way that export to CSV works. You can also try crosstab to see if this helps. What I ended up doing as a workaround is to prefix the headers with a number such as:
1_company_id, 2_project_name, 3_person_name
Thank you for response, but i am not expecting this way,
is there any other way to show the expected results.
Go to Worksheet Menu>Copy>Crosstab and Paste in Excel
Exported .csv would always default to alphabetic view
1 of 1 people found this helpful
As Jeff says, if you're on server, then whether you choose to View Underlying Data via a tooltip option or Click Download ->Data from the server menu toolbar, you will get the View Data pane displayed like below, which will always show all the columns in you primary data source in alphabetical order
This is expected behaviour, but there are plenty of people who would like more control over how the 'view underlying data' option displays - feel free to vote up this idea https://community.tableau.com/ideas/1123
In the meatime, if you have a requirement to provide an 'export to excel' option of an ordered list of specific columns then you will need to
a) create a view that shows the data you want in the right order
b) put the view on a dashboard
c) instruct a user to select Download ->Crosstab from the Server menu instead as this will show the list exactly as you've defined
If the Crosstab option is greyed out, it's likely because none of the views on the dashboard 'have focus', so server doesn't know what data you want to export to crosstab. This can be resolved by clicking on a cell/header in the relevant view and then downloa3d ->crosstab. However, this can be a little fiddly to explain to users
If you don't actually want to show the table of data as you want to show a graphical view of the data, but allow the user to 'export the underlying' data in a specific tabular view, then you can do the above, but 'hide' the view you want to export, and provide a button to do the export instead. See how to do this using Andy Kriebel's blog here The Greatest Tableau Tip EVER: Exporting CSV made simple!
Hope this helps