Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sort by Date and Remove Duplicates

Hi,

I have a number field that has multiple scores on different dates, I need to show only the number with the latest date score, so we need to sort date in desc order and then show only the number and the score at the latest date, removing the duplicates of other dates.

Attached example in excel file

This is urgent, please reply asap

Thanks

4 Replies
Gysbert_Wassenaar

Try this:

Result:

LOAD Number,

     Score,

     Date

FROM [comm161622.xlsx] (ooxml, embedded labels, table is Sheet1);

RIGHT JOIN

LOAD Number, max(Date) as Date

RESIDENT Result

GROUP BY Number

;


talk is cheap, supply exceeds demand
marcus_sommer

You could use a load-statement like:

Load Number, max(date) From x group by Number;

to find your last date and use this for a filter or to join/map these date to your source-table. But you should also have a look on firstsortedvalue() with which you could pick directly within the gui.

- Marcus

Anonymous
Not applicable
Author

Thanks for the reply guys

Thanks Gysbert, I think your solution worked just fine, appreciate it

Anonymous
Not applicable
Author

Hi guys,

gwassenaarmbyjagan

Need your help again, I noticed a few blanks in my data, so now the output should be the latest dated score, in case the latest date has a blank score, then the previous latest date score should be picked up. Desired output colored in Red, please reply asap.

Appreciate your help

Thanks

QV test.png  

   

NumberScoreDate
12341-Apr-14
123422-Jan-14
123411-Jan-14
1111331-Mar-14
111141-Apr-14
999015-Apr-14
999062-Jan-14
999071-Apr-14