Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a file on our ERP system named PRTLST that contains a complete part listing with all details for standard costs
i would like to load this entire file and save as a QVD however there are many duplicates
How can i sort three fields acsending (PartNumber, [Commodity Code],STATUS) then script in to only pull in Unique records?
is this possible in Stage one or must this be done in a two stage process?
I tried the below and i am getting unique record combinations.
However one more step would be greatly appreciated.
If a Part number has three different combinations such as Status Codes and Commodity Codes as seen below, how can i script Qlikview to only select the first record. which has been sorted ascending.
| Part Number | Item Status | Commodity Code |
|---|---|---|
| 6551-246 | 1 | 093 |
| 6551-246 | 4 | OBP |
| 6551-246 | 4 | 093 |
Itemtemp:
LOAD
[Part Number],
[Item Status],
[Commodity Code],
recno() as Recno
FROM $(Stage2QVDPath1)\ItemMaster.qvd(qvd);
Itemtemp2:
JOIN (Itemtemp)
LOAD DISTINCT
min(Recno) as Recno,
[Part Number],
[Item Status],
[Commodity Code]
RESIDENT Itemtemp
GROUP BY [Part Number],[Item Status],[Commodity Code]
ORDER BY [Part Number]ASC,[Item Status]ASC,[Commodity Code]ASC;
Joseph,
All three of these threads you opened seem to be on the same question? Am I understanding correctly?
http://community.qlik.com/forums/p/44389/177904.aspx#177904
Yes, i have researched and cant seem to find solution.
and, since i am new it appears that each time i was unable to communicate my exact problem in a clear enough manner to receive a to the point solution or help and i didnt PM anyone because i know that a lot of times it is recommended to post in forums so other can learn too.
I think i got the issue clearly explained in the third thread but can not script the correct solution.
So you only want to keep unique records based on ONE field instead of three, but sorted in the order of the three? Perhaps something like this:
Itemtemp:
LOAD
[Part Number]
,[Item Status]
,[Commodity Code]
, your other 23 fields
FROM $(Stage2QVDPath1)\ItemMaster.qvd(qvd);
INNER JOIN (Itemtemp)
LOAD *
RESIDENT ItemTemp
WHERE [Part Number]<>previous([Part Number])
ORDER BY [Part Number], [Item Status], [Commodity Code];