Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
eduardoheres
Contributor III
Contributor III

duplicate values in table

Hi All,

Hope you can help me. In a table i have the mix of items code and item description, the problem is that i have a item code with 2 different descriptions, how can i only have the first item description and not 2.

For example my table looks like this 

item codeitem description
133conecting cables
133cables

 

i only want the first row.

 

The main problem is when i export the table to an excel file it appears with duplicate values because i have two descriptions for the item code

 

Thank you!!!

 

 

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Take a look at @Andrius45  post on LinkedIn from a couple of week back.

https://www.linkedin.com/posts/sarkunelis_qlik-qlikview-qliksense-activity-6625394156317487104-FuKi

In short try this:

LOAD 
  [item code],
  firstvalue([item description]) as [item description]
FROM YourData
GROUP BY [item code];

 

Alternatively you could create a maping table and use applymap() to solve your problem.

View solution in original post

4 Replies
Vegar
MVP
MVP

Take a look at @Andrius45  post on LinkedIn from a couple of week back.

https://www.linkedin.com/posts/sarkunelis_qlik-qlikview-qliksense-activity-6625394156317487104-FuKi

In short try this:

LOAD 
  [item code],
  firstvalue([item description]) as [item description]
FROM YourData
GROUP BY [item code];

 

Alternatively you could create a maping table and use applymap() to solve your problem.

eduardoheres
Contributor III
Contributor III
Author

Thank you but when i try to load it it appears to have a an error, 

here is my code

Material:

load

material,

firstvalue(description) as description

from file;

 

when i load it without the firstvlue the load works fine

 

 
Vegar
MVP
MVP

I missed the GROUP BY in my example. I've updated my previous post. 

eduardoheres
Contributor III
Contributor III
Author

Thank you!!