Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
below is sample data, need to get the latest 5 records as per date in chart..i don't want to make use of back end scripting for this as i need all the records , only in this chart want to show top 5 records
| Product | Order date | Sales |
| A | 12/12/2017 | 10 |
| B | 10/10/2017 | 20 |
| C | 1/2/2019 | 30 |
| D | 10/17/2017 | 40 |
| E | 10/27/2019 | 50 |
| F | 1/3/2020 | 60 |
| G | 4/4/2018 | 70 |
| H | 5/12/2018 | 80 |
| I | 7/10/2021 | 90 |
| J | 5/11/2020 | 100 |
Expected output
| Product | Order date | Sales |
| I | 7/10/2021 | 90 |
| J | 5/11/2020 | 100 |
| F | 1/3/2020 | 60 |
| E | 10/27/2019 | 50 |
| C | 1/2/2019 | 30 |
Hi,
Try this..
=sum({<[Order date]={"=rank(TOTAL [Order date])<=5"}>}Sales)
Hi,
Try this..
=sum({<[Order date]={"=rank(TOTAL [Order date])<=5"}>}Sales)
@settu_periasamy thanks a lot, it worked 😀
can you please on below concern as well . Below is the link for query
https://community.qlik.com/t5/New-to-Qlik-Sense/Top-2-lastest-date-data/td-p/1676115
Hi,
It seems, that thread got removed.
But, your expression seems to be fine.
=sum({<[Order date]={"=rank([Order date])<=2"},Product={'A'}>}Sales)
Below is the new link, please suggest
https://community.qlik.com/t5/New-to-Qlik-Sense/Fetching-latest-records-top-2/td-p/1676175