Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator II
Creator II

show only one records from 2

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

2 Replies
BrunPierre
Partner - Master
Partner - Master

With this back-end script

BrunPierre_2-1665695062232.png

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;
vinieme12
Champion III
Champion III

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;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.