Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jmialoundama
Specialist
Specialist

Set analysis : Show 5 last articles create

Hi, 

I have this table in Qlik : 

Article Label_article Quantity Price Rate Date_creation_article
16241 addtg 20 1€ 1 17/12/2022
89896 rresr 54 87€ 0,5 18/04/2021
65778 rrr 30 90€ 0,5 13/06/2022
25266 vgfd 11 50€ 1 14/11/2000
1876 vvh 0 120€ 1 09/10/2011
7982 vvui 1 200€ 1 01/01/2022
2254 vvv 2 154€ 1 02/03/2022

 

I want to retrieve the last 5 articles created in relation to the date "date_create_article" (in my example I need to retrieve the 5 articles in green)

 

How i can do this with set analysis ? 

 

Thanks in advance

Labels (4)
1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

assuming Date_creation_article is properly being read into a date field.  you can do this:

count({<Article = {"=num(Date_creation_article) >= $(=max(Date_creation_article,5))"}>} 1)

 

or this

 

count({<date_creation_article = {">=$(=max(date_creation_article,5))"}>} 1)

 

View solution in original post

4 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi 
have a look at the attached app 

stevejoyce
Specialist II
Specialist II

assuming Date_creation_article is properly being read into a date field.  you can do this:

count({<Article = {"=num(Date_creation_article) >= $(=max(Date_creation_article,5))"}>} 1)

 

or this

 

count({<date_creation_article = {">=$(=max(date_creation_article,5))"}>} 1)

 

jmialoundama
Specialist
Specialist
Author

Hi  Lironbaram, 

I am on QlikView and i can't open your file 😕

jmialoundama
Specialist
Specialist
Author

Hi stevejoyce, 

Thanks you for your answer

I will test your solutions

PREVIEW