Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

wdchristensen
Contributor III

How to easily download all data in Qlik Sense App

Occasionally I have situations where I want to extract all the data from an application. For small applications it is easy enough to create a table and add all the fields as dimensions and “export data” but I have some applications that have over a hundred fields so that becomes tedious. There has to be a better way. Please let me know if you have any alternative recommendations. I appreciate the help!

1 Solution

Accepted Solutions
MVP
MVP

Re: How to easily download all data in Qlik Sense App

This tiny 11 line load script that can be put at the end of any Qlik Sense load script will export all fields and all tables to CSV files:

BINARY "$(vSourceQVW)";

DataModel=;

FOR t=0 TO NoOfTables()-1

  TableName = TableName(t);

  vDataModel = vDataModel & Chr(13) & Chr(10) & Repeat('*',80) & Chr(13) & Chr(10) & TableName;

  FOR f=1 TO NoOfFields(TableName)

     vDataModel = vDataModel & Chr(13) & Chr(10) & '..' & FieldName(f,TableName) ;

  NEXT

  STORE [$(TableName)] INTO "$(TableName).tsv" (txt,delimiter is \t);

NEXT

t=;f=;TableName=;

You can tweak it into 5 lines if you leave out the data model documentation that is not stored anyway... by deleting lines 2, 5-8.

Or a more well-tested solution which is using the QlikView (and Qlik Sense) Components library:

  Storing a Data Model in a Single QVD | Qlikview Cookbook

5 Replies
wdchristensen
Contributor III

Re: How to easily download all data in Qlik Sense App

I was thinking about loading the data to a QVD and then use a tool like EasyMorph | Integration with QViewer‌ to export the data to excel. Any other ideas?

MVP
MVP

Re: How to easily download all data in Qlik Sense App

This tiny 11 line load script that can be put at the end of any Qlik Sense load script will export all fields and all tables to CSV files:

BINARY "$(vSourceQVW)";

DataModel=;

FOR t=0 TO NoOfTables()-1

  TableName = TableName(t);

  vDataModel = vDataModel & Chr(13) & Chr(10) & Repeat('*',80) & Chr(13) & Chr(10) & TableName;

  FOR f=1 TO NoOfFields(TableName)

     vDataModel = vDataModel & Chr(13) & Chr(10) & '..' & FieldName(f,TableName) ;

  NEXT

  STORE [$(TableName)] INTO "$(TableName).tsv" (txt,delimiter is \t);

NEXT

t=;f=;TableName=;

You can tweak it into 5 lines if you leave out the data model documentation that is not stored anyway... by deleting lines 2, 5-8.

Or a more well-tested solution which is using the QlikView (and Qlik Sense) Components library:

  Storing a Data Model in a Single QVD | Qlikview Cookbook

rbartley
Contributor III

Re: How to easily download all data in Qlik Sense App

That's very useful.  Thanks Petter.

MVP
MVP

Re: How to easily download all data in Qlik Sense App

Obsiously it is easy to switch to QVDs instead by changing the STORE... into this:

STORE [$(TableName)] INTO "$(TableName).qvd" (qvd);

wdchristensen
Contributor III

Re: How to easily download all data in Qlik Sense App

Hi petter-s,

Your tiny script is exactly what I was looking for. Awesome solution! Thanks so much for taking the time to share.