Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

Double Counting in Concatenation

Hi All,

I have two QVD files. Sales and Sales_New.

Sales:

  

DateSales
1/1/2016100
1/2/2016200
1/3/2016300

Sales_New:

  

DateSales
1/4/2016400
1/5/2016500

When I am trying to concatenate using below script, the records from Sales table is double counting.

Sales:

LOAD Date,

     Sales

FROM

Sales.qvd

(qvd);

Concatenate

LOAD Date,

     Sales

FROM

Sales_New.qvd

(qvd);

If I am using not exists (date). then it is fine. Why the above script showing double counting data? As per my understanding it should not.

Please advise.

Thanks,

Sarif

15 Replies
rbecher
MVP
MVP

Have a look into the QVD files (or attach them here) and you will find your answer...

Astrato.io Head of R&D
jayaseelan
Creator III
Creator III

Hi,

I Tried your data in my local qlik desktop it not showing double count. Can you please post me Sales.qvd and Sales_New.qvd ? Let us check.

Thanks,

mhmmd_srf
Creator II
Creator II
Author

Please find the attached qvd.

tresesco
MVP
MVP

Your new sales qvd has got all five dates data. Hope that answers.

sunny_talwar

Like Ruben mentioned above, your Sales_New doesn't just include the new data, it also includes the data from Sales.qvd

Capture.PNG

This is screenshot while I load data from Sales_New.qvd. Since the first three dates are available in both the qvds, you see them getting loaded twice. When you use Where Not Exists... the first three values don't get added and only the dates which are not in Sales.qvd gets loaded in.

jayaseelan
Creator III
Creator III

Mohammad Sarif ,


According to your data your count of date is 2 For date(1/1/2016,1/2/2016,1/3/2016).  below is your output.

Because your using Concatenate.  The date is repeating.

instead of count(Date) you can use count(Distrinct Date) you will single count.

Thanks,