Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
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
satyadev_j
Specialist
Specialist

How about using COUNT(Distinct itemnum) in expression?

bruno_montenegr
Creator III
Creator III

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
Luminary Alumni
Luminary Alumni

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