Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

load no duplicate

Hi

I have created a QVD file where duplicate records also exits

Fields

Policy No     

Vehicle Type

I want only to load distinct records to QV document. How can I control it in my load syntax. Pls help

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Have you tried

LOAD DISTINCT

        [Policy No],

        [Vehicle Type]

FROM YourQVD.qvd (qvd);

View solution in original post

7 Replies
swuehl
MVP
MVP

Have you tried

LOAD DISTINCT

        [Policy No],

        [Vehicle Type]

FROM YourQVD.qvd (qvd);

qlikviewwizard
Master II
Master II

Hi,

Please use the script below:

Data:

LOAD distinct Policy No , Vehicle Type

FROM Table;

Hope this will help you.

sasiparupudi1
Master III
Master III

tab1:

LOAD

        [Policy No],

        [Vehicle Type]

Inline

[

Policy No,Vehicle Type

1234,Sedan

1234,Sedan

2345,SUV

2345,SUV

9345,XUV

8907,Sports

];

NoConcatenate

tab2:

LOAD  [Policy No],[Vehicle Type],

if((Previous([Vehicle Type])=[Vehicle Type] and Previous([Policy No])=[Policy No]),1,0)  as DupFlag

Resident tab1

order by [Policy No],[Vehicle Type];

drop Table tab1;

tabNoDups:

NoConcatenate

LOAD * Resident tab2 where DupFlag=0;

drop Table tab2;

sunny_talwar

I think instead of running through the script you suggest, why not just do this:

tab1:

LOAD Distinct [Policy No],

     [Vehicle Type]

Inline

[

Policy No,Vehicle Type

1234,Sedan

1234,Sedan

2345,SUV

2345,SUV

9345,XUV

8907,Sports

];

Is there a reason you choose your method over this?? I always fail to understand how exactly Distinct works the script, so wondering if there are cases you know where DISTINCT may or may not work??

Thanks,

Sunny

sasiparupudi1
Master III
Master III

no special reason..I thought, if he wanted to see the duplicate records, he could do so with my script.

sunny_talwar

Got it

Thank you

qlikviewwizard
Master II
Master II

Hi,

Please close the thread by selecting Correct Answer. Thank you.