Qlik Community

Ask a Question

Qlik Sense App Development

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

Announcements
Qlik Users, make your voice heard! Participate in Wisdom of Crowds® Market Study: Start Survey
cancel
Showing results for 
Search instead for 
Did you mean: 
wdchristensen
Specialist
Specialist

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
petter
MVP
MVP

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

View solution in original post

5 Replies
wdchristensen
Specialist
Specialist

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?

petter
MVP
MVP

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

View solution in original post

rbartley
Specialist
Specialist

That's very useful.  Thanks Petter.

petter
MVP
MVP

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

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

wdchristensen
Specialist
Specialist

Hi petter-s,

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