Skip to main content
Question

Export a viw as csv

  • August 10, 2026
  • 1 reply
  • 14 views

Forum|alt.badge.img+1

Hi,
I am trying to export a view as csv via APOP, but my view is coming weird in Target Sheet. It is just showing Row Headers and that too with dimension name instead of dimension items. When i download that as csv it shows correct but while exporting it to another tool it is showing weird results. 

Please someone explain me the reason and what am i missing?

Thanks

1 reply

Veniamin
Apprentice Helper
Forum|alt.badge.img
  • Apprentice Helper
  • August 12, 2026

Hi Nancy,

I think you're comparing two things that aren't meant to match. The CSV you download from the UI gives you the grid as you see it on screen. The Export API doesn't. It returns your data flattened and unformatted, and everything that sat in rows and columns collapses into rows, with Metrics as the columns. The docs show the shape: Country;Month;Cost;Revenue;Margin. So the first columns are named after your Dimensions, and the Dimension items are in the rows underneath, not in the header. That may be the whole of what you're seeing.

https://kb.pigment.com/docs/export-data-with-apis

The other likely culprit is the separator. The API returns semicolons by default, not commas. If the tool on the other end splits on commas, every row lands in a single column, which looks exactly like "only headers came through".

You can switch it with a query parameter: ?fieldDelimiter=Comma. While you're there, ?dateFormat=Iso8601 is usually kinder to downstream tools than the default.

Two smaller things: If the Block has Scenarios turned on, the API exports the default Scenario rather than whichever one you're looking at, so set the default in page options if you need a different one. And the Export API key has no rights of its own, it inherits the access of whoever created it, so anything that person can't see won't come out.

Could you share the exact URL you're calling, and the first two or three lines of the raw response before your tool touches it? Also, which tool is on the receiving end? If you're feeding a warehouse or something similar rather than a spreadsheet, the raw Block export is usually the better fit than the view export, since you pick the properties, scenarios and filters directly: https://kb.pigment.com/docs/raw-data-block