Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
oliveton
Creator
Creator

Remove Duplicate Values Using Script

Hello,

In one of my excel files I loaded, there are duplicate part numbers.

I want to know how to remove the duplicates in the script.

The duplicates are coming from the "BuyersGuide" file shown below.

Thanks

16 Replies
oliveton
Creator
Creator
Author

And I don't get how this one would remove my duplicates ?

Anonymous
Not applicable

Do you have more than one loading table? If you have, and it uses the same column name, the qlik will duplicate the line to not lose data!

If that is the case, post both scripts so then we can find a fix.

Good luck!

vishsaggi
Champion III
Champion III

Did you try may be with Firstsortedvalue? So can you share some sample data where you have this duplicates we can work on it.

vishsaggi
Champion III
Champion III

Can you try this:

JnpPies:

Load

    Product as JnpPartTerm,

   Text(B15)) as %Carm,

    [ACES Applications],

    [Part Terminology ID] as JnpPartTermID   

From [lib://DATA/mehrere-spalten-vergleichen.xlsx]

      (ooxml, embedded labels, table is Tabelle1)

;

JOIN

LOAD JnpPartTerm,

           Sum(Cnt)      AS RowCnt

Resident JnpPies

Group By JnpPartTerm;

oliveton
Creator
Creator
Author

I do have more than 1 table loaded. I'm just attaching the actual qlik doc so you can see all the script.

I haven't tried firstsortedvalue.

An example of a duplicate value is JV8 under %Cram.

I tried the above join but it loaded with an error so I got rid of it.

Thank you all!

breno_morais
Partner - Contributor III
Partner - Contributor III

Something in your load script is wrong, you have %Cram as your primary key, but it has multiple loads.

Your column PartTearm have different values so the Qlik can't relate it, you need to fix your data

Is this the correct answer? If it's mark as CORRECT, it would help me a lot.

vishsaggi
Champion III
Champion III

Did you try this way?

JnpPies:

LOAD Distinct

//     [Error message],

//     PiesReceiver,

     Product as JnpPartTerm,

    Text(B15) as %Cram,

    1 AS CramCount,

//     [Hazardous Material Code],

//     [Base Item ID],

//     [Item Level GTIN],

//     [GTIN Qualifier],

//     [Brand AAIA ID],

//     [Brand Label],

//     [Sub Brand AAIAID],

//     [SubBrand Label],

     [ACES Applications] ,

//     [Item Quantity Size],

//     [Item Quantity Size UOM],

//     [Container Type],

//     [Quantity per Application Qualifier],

//     [Quantity Per Application],

//     UOM,

//     [Effective Date],

//     [Available Date],

//     [Minimum Order Quantity],

//     [Min Qty Order UOM],

//     Group,

//     [Sub Group],

//     [AAIA Product Category Code],

//     UNSPSC,

     [Part Terminology ID] as JnpPartTermID

//     [VMRS Code]

FROM

(ooxml, embedded labels, table is PiesItem);

JOIN(JnpPies)

LOAD JnpPartTerm,

     Sum(CramCount) AS CramCnt

Resident JnpPies

Group By JnpPartTerm;

When you get an error can you screen shot the error and post it here please?