Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Store existing

How does one go about exporting data that's already part of the app?

For example, I have previously loaded data in a table called "Delivery", and at the beginning of the script I want to export it.

I tried this

2017-01-24_1342.png

which resulted in

2017-01-24_1345.png

All the examples I've found are using Store after tables are loaded in the script, in this case I want to export what I have first before importing anything.

Regards,

Mike

20 Replies
vlad_komarov
Partner - Specialist III
Partner - Specialist III

Mike,

I was assuming you already have some data loaded in the application and you are trying to add some more...

In this case you should have the "Delivery" table available in your data model. Is this the situation?

Or you do not have any data loaded?

VK

Anonymous
Not applicable
Author

There's data in the application yes - all my visualizations are working and the data looks good.

But then when I go back to the data load editor and run the script, I can't seem to get a reference to data in the application that was first imported on a previous script run.

vlad_komarov
Partner - Specialist III
Partner - Specialist III

Can you check the "Data Model" or "Data Manager" views?

You should be able to see all the tables available in your application.  It's possible that the table you are trying to export was dropped or renamed...

VK

Anonymous
Not applicable
Author

Thanks for the replies Vladimir.

The data is there is the data model viewer, but I think I understand what's happening now. I'm new to Qlik Sense so still figuring out how things work.

It appears when one runs the script from the data load editor, the first thing that happens is that Sense deletes any previously loaded data. I can verify this by putting in "Exit Script;" as the very first line in the "Main" section. When I do that and run it, the data is gone (the data model viewer is greyed out and if you run the app, there's no data).

So it appears if I want to export data as the very first step in the script, I would first need to load the .qvd.

That brings up another thing to figure out, which is that Sense doesn't seem to make a .qvd - the data appears to be stored in a file that's named with a GUID (with no extension). I'll save that for another thread if need be.

Regards,

Mike

MK9885
Master II
Master II

Mike, did you check my reply above?

You can store tables into QVD and use that QVD.

And Sense will not delete your data unless you have given any such command (which I do not know).

You need make a connection...

Once the tables are loaded in script and you load it.

Use the Debug mode on the top right of Edit Script to check for the issue.

And as far as I know you cannot export the Data (rows/columns) from a script. You can do it front end once the tables are loaded, export it to XL or PDF.

Anonymous
Not applicable
Author

Yes Aehman, thank you.

What I ended up doing for now is to save off a .qvd at the very end of the script. That way the next time the script runs, I can load that .qvd and then export the data.

vlad_komarov
Partner - Specialist III
Partner - Specialist III

You can export the data directly from the script. The formats are limited, but CSV and TXT options are available.

VK

vlad_komarov
Partner - Specialist III
Partner - Specialist III

Mike,

You are correct, Qlik's engine (in both QV and QS) drops all existing data tables before loading the script. 

About your statement: "the data appears to be stored in a file that's named with a GUID" - this file is actually a qlik "application" that stores not only the data, but all UI controls you have created, variables, etc.

You can load this file, using a Binary load like stalwar1was suggesting above.

I am still not sure why you need to load QVDs and store them at the end of the script...

The usual 3-tier process works the following way:

1. Load Data from DB or External files. Do transformation (if needed), store the data into QVDs (multiple QVDs, if applicable).

2. Load previously created QVDs into the application to build a data model (joining, linking the data). Save this file as QVF without creating any UI elements

3. Load the QVF created in step #2 using Binary load and add all necessary UI components. Publish the application created in step #3.

VK

sunny_talwar

I wish my suggestion was heard earlier

Anonymous
Not applicable
Author

Thanks Vladimir, you've been very helpful. Please do keep in mind that I'm new to Qlik (training is happening over the next couple of weeks).

>>I am still not sure why you need to load QVDs and store them at the end of the script...

This is the real use case:

I get "Delivery" data once a week. This data will always contain year-to-date information, so it will contain duplicates already loaded. There's nothing in the data that would make a unique key (and I have no control over that).

So, what I'd thought I'd do in the script is to access the data that's already in the application, delete everything that's dated in the current year, then load the new year-to-date data.