Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
New Contributor III

Get last date for each record

I want to get get the last date for each part number received into seperate field in the load scripTt what is the best way to go about this ?

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: Get last date for each record

You could do as in script below. First pick out the max date per part and then join in the qty for that date. 

Data:
Load
   part,
   Max(date) as date
From 
   EXCEL.xlsx (...)
Group by 
   part
;

LEFT JOIN (Data)
LOAD 
   part, 
   date, 
   qty
FROM Excel.xlsx (...);

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

3 Replies
Highlighted
Partner
Partner

Re: Get last date for each record

Load *
From
EXCEL.xlsx (...);

Left join
Load
part,
Max(date) as maxdate
From EXCEL.xlsx (...)
Group by part;
Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
New Contributor III

Re: Get last date for each record

Thanks for that but what if I wanted to just have the max date for that part only with the qty ?

How would I do that ?

Highlighted
Partner
Partner

Re: Get last date for each record

You could do as in script below. First pick out the max date per part and then join in the qty for that date. 

Data:
Load
   part,
   Max(date) as date
From 
   EXCEL.xlsx (...)
Group by 
   part
;

LEFT JOIN (Data)
LOAD 
   part, 
   date, 
   qty
FROM Excel.xlsx (...);

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post