Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
vbravomo
Contributor III
Contributor III

QVD incremental

Hi everybody,

Do you know how can I join different files (.csv) in the same QVD?

[Extraccion]:
Load

     ([ID Orden],             
     ([Telefono Acceso],    ...                     
     FileName() as "Fichero"
FROM [lib://Extraccion/??????_Extraccion_completa_provision.csv]
(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes);

Store [Extraccion_Completa_Provision] into [lib://Provision_Escritorio/Extraccion_completa_provision.qvd](qvd);
Drop table [Extraccion];

Note: [lib://Extraccion/??????_Extraccion_completa_provision.csv] --> I download every day a file with the current date, and I have to keep it in a folder where I delete the previous day file.

Thank you

8 Replies
christophebrault
Specialist
Specialist

Hi,

Today, create a QVD from your file using :

Extraccion:

LOAD * ,

         Filename() as Fichero

FROM [lib://Extraccion/*_Extraccion_completa_provision.csv]
(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes);

Store [Extraccion_Completa_Provision] into [lib://Provision_Escritorio/Extraccion_completa_provision.qvd](qvd);
Drop table [Extraccion];

Then, you can concatenate new data from csv to your QVD and create a new one :

// Load the QVD

Extraccion:

LOAD *

FROM [lib://Provision_Escritorio/Extraccion_completa_provision.qvd](qvd);

// concatenate new data

concatenate(Extraccion)

LOAD * ,

         Filename() as Fichero

FROM [lib://Extraccion/*_Extraccion_completa_provision.csv]
(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes);

// replace the old qvd with the new one in the folder

Store Extraccion into [lib://Provision_Escritorio/Extraccion_completa_provision.qvd](qvd);
Drop table [Extraccion];

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
gianpaolo_31
Contributor III
Contributor III

Hi Karen,

Does your latest file contains new records only? Or does it includes previous records also?

vbravomo
Contributor III
Contributor III
Author

Hi Gian,

In every file there are only new information.

Thnaks

christophebrault
Specialist
Specialist

Ok, so my script should work well for your need

(I've edit the final Store)

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
gianpaolo_31
Contributor III
Contributor III

Christophe's script should be fine. but you can also use below. just eliminate creation of another QVD.

Extraccion:

LOAD * ,

         Filename() as Fichero

FROM [lib://Extraccion/*_Extraccion_completa_provision.csv]
(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes);

Store [Extraccion_Completa_Provision] into [lib://Provision_Escritorio/Extraccion_completa_provision.qvd](qvd);
Drop table [Extraccion];

Then, you can concatenate new data from csv to your QVD and create a new one :

// Load the QVD

Extraccion:

LOAD *

FROM [lib://Provision_Escritorio/Extraccion_completa_provision.qvd](qvd);

// concatenate new data

concatenate(Extraccion)

LOAD * ,

         Filename() as Fichero

FROM [lib://Extraccion/*_Extraccion_completa_provision.csv]
(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes);

// replace the old qvd with the new one in the folder

Store [Extraccion_Completa_Provision] into [lib://Provision_Escritorio/Extraccion_completa_provision.qvd](qvd);
Drop table [Extraccion];

vbravomo
Contributor III
Contributor III
Author

I'm not sure if I did it well, but the previous information is deleted. I can chek it because of the colum "Fichero", which contains: "180606_Extraccion.csv"

I've tried with files of JUN05 and JUN06.

Thanks

gianpaolo_31
Contributor III
Contributor III

First you need to do an initial load like this.

[Extraccion]:
Load

     ([ID Orden],             
     ([Telefono Acceso],    ...                     
     FileName() as "Fichero"
FROM [lib://Extraccion/??????_Extraccion_completa_provision.csv]  //<== For example, your previous data
(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes);

Store [Extraccion] into [lib://Provision_Escritorio/Extraccion_completa_provision.qvd](qvd);
Drop table [Extraccion];

After that do an incremental load like below.

[Incremental]:

Load

     ([ID Orden],             
     ([Telefono Acceso],    ...                     
     FileName() as "Fichero"
FROM [lib://Extraccion/??????_Extraccion_completa_provision.csv]  //<== Your latest data
(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes);

Concatenate

Load *

From [lib://Provision_Escritorio/Extraccion_completa_provision.qvd] (qvd)

Where Not Exists([ID Orden]);


Store [Incremental] into [lib://Provision_Escritorio/Extraccion_completa_provision.qvd];

Drop table [Incremental];

Let us know if this helps.

Thanks,

gianpaolo_31
Contributor III
Contributor III

Please mark as answered if this solved your issue,

Thanks.