Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mahitham
Creator II
Creator II

Expression Help

Hi,

Can any one please help me on below requirement.

I have the Source like below

POC.png

From The Date field Derived [Comparision Date] like below

main:
LOAD
    "Date" as ReportDate,  
    ID,
    Name
FROM [lib://test/Add,Remove,Replace.xlsx]
(ooxml, embedded labels, table is Sheet1);
 
comp:
load   "ReportDate" as ComparisionDate
Resident main;
 
Requirement:
By comparing  Max Report Date 13/10/2019 with 12/10/2019 I have to create a Table in UI like below
 
ID         Original Name         Renamed Name
5           E                                      M
 
By comparing Max Report Date 13/10/2019 with 11/10/2019 I have to create a Table in UI like below
ID         Original Name         Renamed Name
5           E                                      M
7           G                                      H
 
By using below expression getting "Renamed Name" column
Only(DISTINCT {<[ ID] = {"=Name <> Only({<[Report Date] = p([Comparision Date])>} Name) and Len(Trim(Name)) > 0 and Len(Trim(Only({<[Report Date] = p([Comparision Date])>} Name))) > 0"}>} Name)
 
But  I am not able to get the "Original Name" Column please help me to get Original Column name.
 
Thanks in advance
 
2 Replies
DavidM
Partner - Creator II
Partner - Creator II

Why don't you add original and new name fields to the table? Like this:

left join (main)
load   Min("ReportDate") as "OriginalDate",
ID,
Name as [OriginalName]
Resident main
group by ID,Name;
 
left join (main)
load   Max("ReportDate") as "NewestDate",
ID,
Name as [LatestName]
Resident main
group by ID,Name;

 

mahitham
Creator II
Creator II
Author

Hi @DavidM 

Could you please provide the UI Solution. I am not able to change the backend script.