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: 
drohm002
Creator
Creator

creating new field, group by?

Hi, please see table below.  I would like to create a field that grabs only one score per ID, but that score has to be of the oldest date for that ID.  please help!

So this new field should return 4 for bill, 8 for sam, and 9 for jon.

  

IDscoredate
bill41/1/2016
bill76/1/2016
sam82/1/2016
sam27/1/2016
jon93/1/2016
jon38/1/2016
11 Replies
MarcoWedel

Do you mean an already loaded (resident) table or a table in a connected DB?

qlikviewwizard
Master II
Master II

Hi Daniel Rohm,

Please check this.

Data:

LOAD ID,score,Date#(date,'MM/DD/YYYY') as Date INLINE [

ID,score,date

bill,4,1/1/2016

bill,7,6/1/2016

sam,8,2/1/2016

sam,2,7/1/2016

jon,9,3/1/2016

jon,3,8/1/2016

];

inner join(Data)

Data_Finala:

LOAD distinct ID,min(Date) as Date resident Data group by ID;

Capture.PNG

Capture1.PNG