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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ishanahiya
Contributor
Contributor

Last 25 records with data

I can load the first 25 records from the ModifiedDate field with this script

First 25
Load
ModifiedDate

from DateWorksheet.csv;

However instead, I want to load the last 25 records with data from the ModifiedDate field so empty records are excluded. Can you help?

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

If you are loading from a CSV, you probably cant avoid loading all the date first to do this. Something like this:

 

T_Data:
LOAD *, RowNo() as RowID
FROM <your data source>
WHERE Len(ModifiedDate) > 0;

Let zRowCount = Peek('RowID');

Data:
NoConcatenate
LOAD * 
Resident 
WHERE RowID >= $(zRowCount) - 25;

DROP Table T_Data;

 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

If you are loading from a CSV, you probably cant avoid loading all the date first to do this. Something like this:

 

T_Data:
LOAD *, RowNo() as RowID
FROM <your data source>
WHERE Len(ModifiedDate) > 0;

Let zRowCount = Peek('RowID');

Data:
NoConcatenate
LOAD * 
Resident 
WHERE RowID >= $(zRowCount) - 25;

DROP Table T_Data;

 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein