Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Have you tried
LOAD DISTINCT
[Policy No],
[Vehicle Type]
FROM YourQVD.qvd (qvd);
Have you tried
LOAD DISTINCT
[Policy No],
[Vehicle Type]
FROM YourQVD.qvd (qvd);
Hi,
Please use the script below:
Data:
LOAD distinct Policy No , Vehicle Type
FROM Table;
Hope this will help you.
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;
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
no special reason..I thought, if he wanted to see the duplicate records, he could do so with my script.
Got it
Thank you
Hi,
Please close the thread by selecting Correct Answer. Thank you.