Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $400 before Dec 31st: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
jmialoundama
Creator III
Creator III

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
Creator III
Creator III
Author

Hi  Lironbaram, 

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

jmialoundama
Creator III
Creator III
Author

Hi stevejoyce, 

Thanks you for your answer

I will test your solutions

PREVIEW