Solved

Column Order when Downloading Data

  • 5 March 2020
  • 8 replies
  • 1903 views

Userlevel 1

Hi all.


I’ve created a relatively simple look for a client. It has more than 70 columns: 4 measures, 16 table calculations, and 50-odd dimensions.


The thing is, the columns have to be displayed in a specific order. And that order has the 16 table calculations shown first, and the 4 measures randomly interspersed among the dimensions. This actually works OK so far: I just visualized the data as a table and drag-and-dropped the columns to the right places.


But the whole reason for the bizarro order is that after visually inspecting the data, the client needs to be able to download the data, and the downloaded data needs to be in the exact same format. And when I download the data, instead I get columns in the order they’re shown in the underlying data: dimensions first, followed by table calculations, and measures at the end. And the dimensions aren’t even in the right order, because I had to jump around when I first added them.


Is there a way around this? Maybe something I can do differently? I know Looker is designed with cases like this in mind because the docs on downloading includes sentences like this:



This is often preferred when data is being fed into another tool for processing.



Thank you so much! This is day 2 of using the tool and question #2 in the forum; I really appreciate the Looker community.

icon

Best answer by Dawid_Nawrot 16 July 2020, 15:04

But the order in which you select and build your measures will be reflected in the export. Unless you need to mix the position of measures & calculations, then in this case we still have the same problem

View original

8 replies

Userlevel 5

This is definitely an important feature. I believe that when you use the Download, the query runs in the background but it doesn’t go through the visualisation layer (if we’re talking about csv) therefore the columns you re-organised are never treated by that step.


It’s an important feature that the download but not sure how it could be implemented. Probably allowing the data to go through visualisation layer only if it’s a table to get the ordering.


Definitely a feature request worth looking into! Thanks Benjamin for raising it!

Userlevel 1

I have this same use case. We need this feature for importing into other systems.


Are there any workarounds for making the downloaded export file columns appear in the same order as the visualization table?

Userlevel 5

Have you tried building the Look in a way that your data comes in an order you want without any changes?

Userlevel 1

That would be ideal, and please correct me if I’m wrong, but measures and table calculations can’t be re-ordered.

Userlevel 5

But the order in which you select and build your measures will be reflected in the export. Unless you need to mix the position of measures & calculations, then in this case we still have the same problem

Userlevel 1

Yes, unfortunately measures, dimensions and calculations all need to be mixed. This is for an import into an external system with no flexibility.


Workaround will be doing this outside of the system with awk.

Hi, I also have the same case. A workaround is to create new dimensions instead of using table calculations, but it’s not ideal because we will use those dimensions in only 1 Look.

 

Please share if there is any progress in the matter. Thanks!

Definitely would like to add a +1 to this as a feature request. I have a client request for a dashboard that places measures in the middle of a table, but they are pushed to the right end of the table when downloading as a CSV. 

Reply