Prashant Sharma
04/15/2022, 3:22 PMError: Tiger backend does not support exports
Is there a way to export the insights as CSV and XLSX in Gooddata-CN using Tiger backend?
cc: @Peter PlochanMartin Burian
04/17/2022, 9:27 AMJan Soubusta
04/19/2022, 9:10 AMPrashant Sharma
04/19/2022, 1:32 PMJan Soubusta
04/20/2022, 12:59 PMDan Homola
04/20/2022, 1:18 PMimport { DataViewFacade } from "@gooddata/sdk-ui";
import { idRef } from "@gooddata/sdk-model";
// get the insight and create an execution for it
// the backend object is an instance of IAnalyticalBackend
const insight = await backend.workspace(WORKSPACE_ID).insights().getInsight(idRef(INSIGHT_ID));
const execution = backend.workspace(WORKSPACE_ID).execution().forInsight(insight);
// run the execution and read all the data
const result = await execution.execute();
const allData = await result.readAll();
// wrap it into a DataViewFacade and read the individual series
const dataViewFacade = DataViewFacade.for(allData);
const series = dataViewFacade.data().series().toArray();
// and do some conversion to CSV from the series data
this will get you an object with all the values you need, but you will need to implement the conversion to CSV/XLSX yourself.Prashant Sharma
04/20/2022, 1:32 PMJan Soubusta
04/20/2022, 2:24 PMfrom gooddata_pandas import GoodPandas
gdpd = GoodPandas(host=HOST, token=TOKEN)
gdf = gdpd.data_frames(WORKSPACE_ID)
# Execute insight, get data frame
df = gdf.for_insight(insight_id=INSIGHT_ID)
# Write result as CSV/XLSX
with open(INSIGHT_ID + '.csv', 'w') as fd:
df.to_csv(fd, index=False)
with open(INSIGHT_ID + '.xlsx', 'w') as fd:
df.to_excel(fd, index=False)
Prashant Sharma
05/05/2022, 3:38 PMJan Soubusta
05/05/2022, 5:40 PMMartin Svadlenka
05/05/2022, 6:49 PMPrashant Sharma
07/14/2022, 3:36 PMMartin Svadlenka
07/20/2022, 8:28 AMZoltan Mazula
09/12/2022, 12:31 PMZoltan Mazula
09/13/2022, 5:31 AMMartin Svadlenka
09/19/2022, 9:51 AMZoltan Mazula
09/19/2022, 11:32 AMAndrey Skripnikov
09/19/2022, 12:07 PMZoltan Mazula
09/19/2022, 12:39 PMZoltan Mazula
09/19/2022, 12:39 PM