Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ADD NEW DATA TO EXISTING QVD

Hi,

I have a question, i want to add only new data from xls file to existing qvd file. For Example:

My QVD File has this data:

NTNAME     POSITION     AREA

ABC            A                   AREA1

DEF            B                   AREA2

GHI             C                  AREA3

AND i have one xls file has this data:


NTNAME     POSITION     AREA

ABC                 A              AREA2

D                      B              AREA2

G                      C              AREA3

DEF                 B               AREA2

I want to have this result:

NTNAME     POSITION     AREA

ABC                 A               AREA1   ("ABC" FROM XLS FILE NOT ADDED to QVD, because "ABC" already exist in qvd file although                                                        "ABC" in XLS file has different AREA with ABC in QVD)

DEF                  B               AREA2

GHI                   C               AREA3

D                       B               AREA2 (D is added because no NTNAME "D" in QVD FILE)

G                      C               AREA3 (G is added because no NTNAME "G" in QVD FILE)

I cant use distinct because if I use distinct, ABC in XLS FILE will be added to qvd file because differ AREA.

Really need your helps, Thanks

Regards,

Indra

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Add a primary-key column to your QVD. A primary key is a unique identifier of a specific record. In DBMS, a primary key value can not appear twice in the same table.

The content of this primary key can be a concatenation of NTNAME and AREA if you want unique combinations of these value,s or just plainly NTNAME as per your description.

Then only load from your XLS with a clause like

CONCATENATE (DataFromQVD)

LOAD

:

FROM Excel

WHERE NOT Exists(PrimaryKey, concatenation of fields in primary key);

or following your description:

CONCATENATE (DataFromQVD)

LOAD

:

FROM Excel

WHERE NOT Exists(NTNAME);

Best,

Peter

View solution in original post

2 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Add a primary-key column to your QVD. A primary key is a unique identifier of a specific record. In DBMS, a primary key value can not appear twice in the same table.

The content of this primary key can be a concatenation of NTNAME and AREA if you want unique combinations of these value,s or just plainly NTNAME as per your description.

Then only load from your XLS with a clause like

CONCATENATE (DataFromQVD)

LOAD

:

FROM Excel

WHERE NOT Exists(PrimaryKey, concatenation of fields in primary key);

or following your description:

CONCATENATE (DataFromQVD)

LOAD

:

FROM Excel

WHERE NOT Exists(NTNAME);

Best,

Peter

Not applicable
Author

Hi Peter,

Wow, thanks for your help, it solved my problem.

Really appreciate your help.

Thanks.

Regards,
Indra