Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've below data.
ID | Date1 | Date2 | Value |
1001 | 7/23/2023 | 12/31/2023 | A |
1002 | 1/1/2024 | 12/31/2025 | A |
2003 | 3/6/2019 | 6/8/2021 | B |
456 | 6/7/2022 | 12/18/2022 | C |
5963 | 3/9/2023 | 9/8/2025 | D |
9635 | 6/8/2024 | 2/25/2025 | E |
3698 | 2/26/2025 | 6/9/2026 | E |
Looking for output like below where I want to load values which are close to current year
ID | Date1 | Date2 | Value |
1001 | 7/23/2023 | 12/31/2023 | A |
2003 | 3/6/2019 | 6/8/2021 | B |
456 | 6/7/2022 | 12/18/2022 | C |
5963 | 3/9/2023 | 9/8/2025 | D |
9635 | 6/8/2024 | 2/25/2025 | E |
Regards,
V
With this back-end script
Temp:
LOAD ID,
Date(Date#(Date1,'MM/DD/YYYY'),'MM/DD/YYYY') as Date1,
Date(Date#(Date2,'MM/DD/YYYY'),'MM/DD/YYYY') as Date2,
Value
FROM
[https://community.qlik.com/t5/New-to-Qlik-Sense/show-only-one-records-from-2/td-p/1992396]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);
NoConcatenate
Final:
LOAD Value,
Max(ID) AS ID,
Min(Date1) as Date1,
Min(Date2) as Date2
Resident Temp
Group By Value
Order By Value,ID;
DROP Table Temp;
As below:
Main:
Load
ID,Date1,Date2,Value
From Xyz;
Inner Join(Main)
Load Value,Date(Min(Date2)) as Date2
Resident Main Group By Value;