Discussion Board for collaboration on QlikView Scripting.
I have a table with the following fields:
I want to remove the duplicate records while script loading process based on distinct(MEMBERID)
Go to Solution.
FirstValue(ADDRESS) AS ADDRESS,
FirstValue(STATE) AS STATE,
FirstValue(COUNTY) AS COUNTY,
FirstValue(EMAIL) AS EMAIL
GROUP BY MEMBERID ;
LOAD DISTINCT MEMBERID
If(Previous(MEMBERID) = MEMBERID, 0, MEMBERID) As MEMBERID,
Order By MEMBERID
Hope it helps
LOAD DISTINCT MEMBERID /////only this field will be distinct or unique.
Have on mind that during the regular select distinct, load dialog box will show many records fetched, but in your table will be correct.
I tried that before but it seems to be not working. I am using a QVD file as a source. Does that affect anything?
Where we have all said FROM BLAH.XLS that needs to be FROM ..........QVD
Thanks Chris Conejero, this worked perfectly for me. I had been trying the FIRSTVALUE method but kept running out of memory and it was very slow (1.5million records).
Using the LOAD Distinct method was a lot faster, did not run out of memory and did the job exactly as you described:
I already knew I had 1,488,448 records with 6 duplicates (In a Straight table I used Count(MEMBERID) and Count(Distinct MEMBERID) to check)
The LOAD routine stated it loaded 1,488,448 records and then the straight table showed 1,488,442 for both the Count and Count Distinct.
Thank you very much, even though your answer wasn't what hkgandhi was after it was exactly what I needed.