Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
sanjujeeboy
Creator
Creator

How to load updated records

Hi All,

I have a table  named Old , which is loaded in Qlikview. Now these values gets updated and my requirement is : the table should be updated with new values as in table new. How could i achieve this

 

New  
DateCampaignLeads
4/16/2020A50956
4/17/2020B7078
4/18/2020C51248
4/19/2020D7740
4/20/2020E2100
   
   
Old   
DateCampaignLeads
4/16/2020A50956
4/17/2020B6568
4/18/2020C49378
4/19/2020D7660
4/20/2020E1908
Labels (1)
1 Solution

Accepted Solutions
Saravanan_Desingh

One solution is:

tab1:
LOAD *, 2 As File INLINE [
    Date, Campaign, Leads
    4/16/2020, A, 50956
    4/17/2020, B, 7078
    4/18/2020, C, 51248
    4/19/2020, D, 7740
    4/20/2020, E, 2100
];

Concatenate
LOAD *, 1 As File INLINE [
    Date, Campaign, Leads
    4/16/2020, A, 50956
    4/17/2020, B, 6568
    4/18/2020, C, 49378
    4/19/2020, D, 7660
    4/20/2020, E, 1908
];

Left Join (tab1)
LOAD Date, Campaign, Max(File) As File_Max
Resident tab1
Group By Date, Campaign
;

tab2:
LOAD Date, Campaign, Leads
Resident tab1
Where File=File_Max
;

Drop Table tab1;

commQV26.PNG

View solution in original post

2 Replies
Saravanan_Desingh

One solution is:

tab1:
LOAD *, 2 As File INLINE [
    Date, Campaign, Leads
    4/16/2020, A, 50956
    4/17/2020, B, 7078
    4/18/2020, C, 51248
    4/19/2020, D, 7740
    4/20/2020, E, 2100
];

Concatenate
LOAD *, 1 As File INLINE [
    Date, Campaign, Leads
    4/16/2020, A, 50956
    4/17/2020, B, 6568
    4/18/2020, C, 49378
    4/19/2020, D, 7660
    4/20/2020, E, 1908
];

Left Join (tab1)
LOAD Date, Campaign, Max(File) As File_Max
Resident tab1
Group By Date, Campaign
;

tab2:
LOAD Date, Campaign, Leads
Resident tab1
Where File=File_Max
;

Drop Table tab1;

commQV26.PNG

View solution in original post

Saravanan_Desingh

Adding a data which doesn't have New record.

tab1:
LOAD *, 2 As File INLINE [
    Date, Campaign, Leads
    4/16/2020, A, 50956
    4/17/2020, B, 7078
    4/18/2020, C, 51248
    4/19/2020, D, 7740
    4/20/2020, E, 2100
];

Concatenate
LOAD *, 1 As File INLINE [
    Date, Campaign, Leads
    4/16/2020, A, 50956
    4/17/2020, B, 6568
    4/18/2020, C, 49378
    4/19/2020, D, 7660
    4/20/2020, E, 1908
    5/1/2020, F, 100
];

Left Join (tab1)
LOAD Date, Campaign, Max(File) As File_Max
Resident tab1
Group By Date, Campaign
;

tab2:
LOAD Date, Campaign, Leads
Resident tab1
Where File=File_Max
;

Drop Table tab1;