Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

force distinct?

Hi, I have a field called itemnum. if the excel file has many duplicates for one itemnum because of different dates for one itemnum, can i sort of force distinct itemnum in qlikview regardless of the many different date records for one itemnum? Thanks.

3 Replies
Anonymous
Not applicable
Author

How about using COUNT(Distinct itemnum) in expression?

Anonymous
Not applicable
Author

Hi, Rachel.

That depends of your exact requirements. Let's say you want to count the distinct itemnum. It is as simply as using this expression in your charts:

Count(Distinct itemnum).

If you want to load only distinct itemnum, you'll have to ditch the dates. Probably you don't want that. Anyway, the load statement in the script would be:

Load Distinct

     itemnum,

     [other fields that aren't different for one itemnun]

From file.xls....

Hope it answers your doubts.

Regards.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You'll probably want to do the distinction at load time like:

Items:

LOAD

     ItemNum

     ,max(ItemDate) as ItemDate

     , ItemNum

FROM...

GROUP BY ItemNum, ItemNum

;

-Rob