API statistics data by Team

I have been trying to export statistics (/api/v1/statistics). I have been able to export data from a specific variable by data collection teams. But when I add a conditional variable and pivot, the data is no longer categorised by teams.

Is there a way to export a table that has both the variables?


Table exported by teams


Table exported by defined variables, but no longer categorised by teams.

Dear Ashwini Kalantri,

could you please replicate that on the demo server using any questionnaire with data?
If the problem appears there too, please indicate the exact query line.

I assume you are first building this interactively through the Survey Statistics report. If not, please first try to build the report through UI and see whether you are getting the desired output.

Best, Sergiy

Dear @sergiy, Thank you. I have used both the Survey Solutions API UI and a modified version of the R package to export. Both deliver the same output. I will be happy to test this on the demo server, but I can’t find the API user credentials for the demo server.

Attaching the output from our server:

If there is a problem with API, then the R-package will also be affected.
Do you see the problem when using the UI (user interface) on the web?
you don’t need API credentials/access for that, just a normal HQ account.
The address line shows the query.

Based on what I see in the request you’ve posted here, this report will not be able to produce the requested table, since it will be 3-dimensional (with team members being the 3rd dimension).
When I try that in the interface, switching the radio button (By Teams --> By Team Members) also has no effect.

I am afraid you will need to export the data and tabulate it directly using R.

Dear @sergiy, I was looking for 3-dimensional data. I would be great to have the functionality baked in the APIs. Downloading the data every time is a tedious task. For our monitoring, we have set data pull every 6 hours, and it takes about 30 mins to pull all data and then wrangle it.

Thanks.