Home Forums The XBRL API Sorting on a field that is not returned

Viewing 2 reply threads
  • Author
    • #118958
      Peter Guldberg

      It used to be possible to sort on a field that was not returned, for example like this:


      but that no longer seems to be working. If I move the report.id into the fields list it works fine, but then it also gets returned in the query.

    • #118963
      David Tauriello

      I checked with team and there haven’t been any changes that would impact .sort, which is applied on returned fields per the documentation:

      Any value returned can be sorted in ascending or descending order, by adding an additional property to a field value.

      Maybe the sort is on one of the period fields in the query you posted – ? the BS Compare template uses this: https://api.xbrl.us/api/v1/fact/search?report.id=22860,22861,22862&fact.ultimus=1&concept.local-name=DocumentPeriodEndDate&fact.has-dimensions=false&fields=period.fiscal-period,period.fiscal-year,report.id.sort(DESC)

    • #118982
      Peter Guldberg

      All right – maybe it was never meant to work. Basically, the query I posted definitely used to work, but now it doesn’t. However, it’s entirely possible that it was never meant to work.

      I think my question here really is: Is there a way to sort the returned fields on a field that is not itself returned?
      I agree that the documentation would seem to indicate that you can only sort on fields that are actually returned.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.