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 2 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 2 records
Need to fetch Top 2 data for Product A based on order date
| Product | Order date | Sales | Country |
| A | 12/12/2017 | 10 | India |
| A | 12/12/2017 | 20 | Japan |
| A | 1/2/2019 | 30 | US |
| A | 10/17/2017 | 40 | Canada |
| B | 10/27/2019 | 50 | India |
| B | 1/3/2020 | 60 | Japan |
| B | 4/4/2018 | 70 | US |
| B | 5/12/2018 | 80 | Canada |
| B | 7/10/2021 | 90 | Japan |
| B | 5/11/2020 | 100 | US |
Expected Output
| A | 20 | Japan |
| A | 30 | US |
In chart only Product,Country and SUM(sales) needs to be displayed
Below is the expression I am using and its give below result
sum({<[Order date]={"=rank(if(Product='A', [Order date]))<=2"}>}Sales)
Output coming -
| A | 10 | India |
| A | 20 | Japan |
| A | 30 | US |
Expected Output
| A | 20 | Japan |
| A | 30 | US |
Please suggest,its very urgent.
Typing on my phone, but this can be achieved with the FirstsortedValue... a quick google can get you there.
Tried but didn't worked..
Why would you not expect India as it also has a 12/12 date?
Because than 3 reords will starts coming and we need to shown only top 2..