Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get subset of records

Hi Guys

Please see my record sets below. I want to able to retrieve the records between and including the first and last Booking Dates for each month (highlighted in yellow).

Please note that the first and last Booking Dates for each month are different.

Any help would be appreciated.



                                                                                                                                                                           

Regards,

Magen

2 Replies
MK_QSL
MVP
MVP

Do you mean to say that first and last date from only highlighted sections?

You can use FirstSortedValue() function both either in script or in UI level..

maxgro
MVP
MVP

see attachment

if  your table is Tmp1, the expression to identify the records should be (bold)

Final:

load

  ServiceRenderedDate, Sales, BookingDate,

  if(not IsNull(BookingDate),

  alt(peek(Flag),0)+1,

  if(peek(Flag)=2, null(), peek(Flag)

  )) as Flag        // 1 or 2 for record included

Resident Tmp1

order by ServiceRenderedDate;

P.S.: maybe you have to replace isnull(BookingDate) with some other function (len(trim(BookingDate))>0)

1.jpg