Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 sanjujeeboy
		
			sanjujeeboy
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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 | ||
| 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 | 
| Old | ||
| 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 | 
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;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;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;
