Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qliklearnervir
Creator
Creator

Top 1 Record from Minimum Created Date

Hi,

I have 1 requirement where i want to pull Top 1 record from minimum created date .

Columns are given below:

Prospect:

Person_wid,

ACQ_Date,

ACQ_Source,

Created_Date

I wan to pull 1 row for each Person_wid with Applying logic for Top 1 record from minimum created date.

Please suggest.

6 Replies
PrashantSangle

you can use firstSortedValue()

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
qliklearnervir
Creator
Creator
Author

Can you give me a written script...as i have never used it before...

PrashantSangle

Hi,

below example from help menu

Temp:

LOAD * inline [

Customer|Product|OrderNumber|UnitSales|CustomerID

Astrida|AA|1|10|1

Astrida|AA|7|18|1

Astrida|BB|4|9|1

Astrida|CC|6|2|1

Betacab|AA|5|4|2

Betacab|BB|2|5|2

Betacab|DD|12|25|2

Canutility|AA|3|8|3

Canutility|CC|13|19|3

Divadip|AA|9|16|4

Divadip|AA|10|16|4

Divadip|DD|11|10|4

] (delimiter is '|');

FirstSortedValue:

LOAD Customer,FirstSortedValue(Product, UnitSales) as MyProductWithSmallestOrderByCustomer Resident Temp Group By Customer;

Here there are calculating Customer purchasing product at  lowest price.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Kushal_Chawda

Prospect:

Person_wid,

ACQ_Date,

ACQ_Source,

Created_Date

FROM table;

left join(Prospect)

LOAD Person_wid,

           Firstsortedvalue(distinct ACQ_Source, Created_Date) as ACQ_Source_Min

Resident Prospect

group by Prospect;

qliklearnervir
Creator
Creator
Author

HOw we can perfrom group by using table name  like group by Prospect;

Kushal_Chawda

it's typo

Prospect:

Person_wid,

ACQ_Date,

ACQ_Source,

Created_Date

FROM table;

left join(Prospect)

LOAD Person_wid,

           Firstsortedvalue(distinct ACQ_Source, Created_Date) as ACQ_Source_Min

Resident Prospect

group by Person_wid;