KNOWLEDGE BASE

How to sort and download the data of Admin Insights data source when querying the view data using REST API: Query View Data


Published: 15 Jun 2022
Last Modified Date: 16 Jun 2022

Question

How to sort and download the data of Admin Insights data source when querying the view data using REST API: Query View Data

Environment

  • Tableau Cloud

Answer

Put the fields to the shelf then query the view data using REST API: Query View Data.
User-added image

The sort order of the query result is not the order in the shelf but alphabetically sorted within the shelf.
If you want to control the sort order of the query result data, for example, you need to rename the field and to number them.

Note that if the field is time series, the name will automatically contain "Seconds of" or something like that at the beginning of the field and this might get the sort order unexpectedly changed.
User-added image

User-added image

In order to avoid this (to get rid of "Seconds of" in the field name), you can use calculated field and STR function to change the time series data to string data like below.
  • STR(<field of time series>)
User-added image

 
Did this article resolve the issue?