Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
drjoffily
New Contributor III

How to get the difference between two datasets?

Hi all,

I have a daily CSV file and I'm trying to create a history file based on the records that are in "Yesterday's file" but not in "today's file". To do that I'm trying to get the difference between yesterday's file and today's file. Whatever is in yesterday's file but not in today's file I'll save in a separate QVD. Concatenate it with my results from before yesterday's results.

My yesterday's file is already in a QVD and my today's file is still in CSV format. So, what I'm trying to do is to load both, my QVD and my CSV into a QVW and manipulate it to get the difference between both.

Here is an ideas I got from the community but is not working for me yet.

Daily_Dump:

Load * From TradeDump.CSV

Yesterday_Daily_Dump:

Load * From TradeDump.qvd

MissingInDailyDump:

LOAD * Resident Yesterday_Daily_Dump
Where not Exists(MissingInDailyDump.[Transaction Number],Daily_Dump.[Transaction Number]);

store MissingInDailyDump into MissingInDailyDump.qvd(qvd);

Does anyone know how to make the script above work?

Or, does anyone have a better idea?

Cheers,

Marcos

1 Solution

Accepted Solutions
lironbaram
Honored Contributor II

Re: How to get the difference between two datasets?

hei attach is an example
the script goes like this
Today:
LOAD Tran_number,
Amonunt
FROM

(
ooxml, embedded labels, table is Today);

Yesterday:
NoConcatenate LOAD Tran_number,
Amonunt
FROM

(
ooxml, embedded labels, table is Yesterday)
where not Exists(Tran_number);

drop table Today;
2 Replies
lironbaram
Honored Contributor II

Re: How to get the difference between two datasets?

hei attach is an example
the script goes like this
Today:
LOAD Tran_number,
Amonunt
FROM

(
ooxml, embedded labels, table is Today);

Yesterday:
NoConcatenate LOAD Tran_number,
Amonunt
FROM

(
ooxml, embedded labels, table is Yesterday)
where not Exists(Tran_number);

drop table Today;
drjoffily
New Contributor III

How to get the difference between two datasets?

Nice one!

Thanks Liron.

Community Browser