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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
pernillet
Contributor II
Contributor II

How to only load the first date

I have a Date called D3_Recognition date, and I only want the lowes date in the database for each distinct D3_JH key. Can anyone tell my, why I load more than one value for the date per key?

$(QVD_Name)_TMP:

//first 1000

LOAD

   
"D3_RecognitionDate",

   
"D3_JH";

SQL SELECT

    "D3_RecognitionDate",

    "D3_JH"

    FROM databasename.databasenamejohndo A

    group by D3_JH, D3_RecognitionDate

    having "D3_RecognitionDate" = (select min("D3_RecognitionDate") FROM databasename.2 B where B.D3_JH = A.D3_JH group by D3_JH )

;



1 Reply
Anonymous
Not applicable

This should work for you:

LOAD

    "D3_RecognitionDate",

    "D3_JH";

SQL SELECT

   min("D3_RecognitionDate") as "D3_RecognitionDate",

    "D3_JH"

FROM databasename.databasenamejohndo A

group by D3_JH