Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nickedw0
Creator
Creator

Issue with Multiple Left Keep

Why does the left keep not work for the second and third references below?

Thanks for your help.

 

 

/*Left Keep for tables
  tLkUp1 results in 4 rows (Regn01, -02, -04, -05)
  tLkUp2 should have 3 rows (Regn03, -04, -01)
  tLkUp3 should have 2 rows (Regn02 and Regn07)
  Table tLkUp1 is correct but tLkUp2 and tLkUp3 has full tRef table of 7 rows.
 
*/

tRef:
LOAD * Inline [Ky,LkUp1,LkUp2,LkUp3
 Regn01,AAA,1,2
 Regn02,BBB,1,2
 Regn03,CCC,1,2
 Regn04,DDD,1,2
 Regn05,EEE,1,2
 Regn06,FFF,1,2
 Regn07,GGG,1,2
 ];  

tMaster:
Load * Inline
 [RecID,GasRegion,WaterRegion,WindRegion,FldA,  FldB
 1, Regn01,   Regn03,   Regn02,  AVal1, BVal1
 2, Regn02,   Regn04,   Regn07,  AVal2, BVal2
 3, Regn04,   Regn03,   Regn07,  AVal4, BVal4
 4, Regn05,   Regn01,   Regn07,  AVal5, BVal5
 ];
 
tLkUp1:
Left Keep
// Preceding table load:
Load
 Ky as GasRegion
 ,LkUp1 As LkUpVals1a
 ,LkUp2 As LkUpVals1b
 ,LkUp3 as LkUpVals1c
 Resident tRef
 ;
 

tLkUp2:
Left Keep
// Preceding table load:
Load
 Ky as WaterRegion
 ,LkUp1 as LkUpVals2a
 ,LkUp2 as LkUpVals2b
 ,LkUp3 as LkUpVals2c
 Resident tRef
 ;

tLkUp3:
Left Keep
// Preceding table load:
Load
 Ky as WindRegion
 ,LkUp1 as LkUpVals3a
 ,LkUp2 as LkUpVals3b
 ,LkUp3 as LkUpVals3c
 Resident tRef
 ;

1 Solution

Accepted Solutions
sunny_talwar

Give Left Keep the name of the table you are Left Keeping against... without the name.. it left keeps against the table right above it

tRef:
LOAD * Inline [Ky,LkUp1,LkUp2,LkUp3
 Regn01,AAA,1,2
 Regn02,BBB,1,2
 Regn03,CCC,1,2
 Regn04,DDD,1,2
 Regn05,EEE,1,2
 Regn06,FFF,1,2
 Regn07,GGG,1,2
 ];  

tMaster:
Load * Inline
 [RecID,GasRegion,WaterRegion,WindRegion,FldA,  FldB
 1, Regn01,   Regn03,   Regn02,  AVal1, BVal1
 2, Regn02,   Regn04,   Regn07,  AVal2, BVal2
 3, Regn04,   Regn03,   Regn07,  AVal4, BVal4
 4, Regn05,   Regn01,   Regn07,  AVal5, BVal5
 ];
 
tLkUp1:
Left Keep (tMaster)
// Preceding table load:
Load
 Ky as GasRegion
 ,LkUp1 As LkUpVals1a
 ,LkUp2 As LkUpVals1b
 ,LkUp3 as LkUpVals1c
 Resident tRef;
 

tLkUp2:
Left Keep (tMaster)
// Preceding table load:
Load
 Ky as WaterRegion
 ,LkUp1 as LkUpVals2a
 ,LkUp2 as LkUpVals2b
 ,LkUp3 as LkUpVals2c
 Resident tRef;

tLkUp3:
Left Keep (tMaster)
// Preceding table load:
Load
 Ky as WindRegion
 ,LkUp1 as LkUpVals3a
 ,LkUp2 as LkUpVals3b
 ,LkUp3 as LkUpVals3c
 Resident tRef;

View solution in original post

1 Reply
sunny_talwar

Give Left Keep the name of the table you are Left Keeping against... without the name.. it left keeps against the table right above it

tRef:
LOAD * Inline [Ky,LkUp1,LkUp2,LkUp3
 Regn01,AAA,1,2
 Regn02,BBB,1,2
 Regn03,CCC,1,2
 Regn04,DDD,1,2
 Regn05,EEE,1,2
 Regn06,FFF,1,2
 Regn07,GGG,1,2
 ];  

tMaster:
Load * Inline
 [RecID,GasRegion,WaterRegion,WindRegion,FldA,  FldB
 1, Regn01,   Regn03,   Regn02,  AVal1, BVal1
 2, Regn02,   Regn04,   Regn07,  AVal2, BVal2
 3, Regn04,   Regn03,   Regn07,  AVal4, BVal4
 4, Regn05,   Regn01,   Regn07,  AVal5, BVal5
 ];
 
tLkUp1:
Left Keep (tMaster)
// Preceding table load:
Load
 Ky as GasRegion
 ,LkUp1 As LkUpVals1a
 ,LkUp2 As LkUpVals1b
 ,LkUp3 as LkUpVals1c
 Resident tRef;
 

tLkUp2:
Left Keep (tMaster)
// Preceding table load:
Load
 Ky as WaterRegion
 ,LkUp1 as LkUpVals2a
 ,LkUp2 as LkUpVals2b
 ,LkUp3 as LkUpVals2c
 Resident tRef;

tLkUp3:
Left Keep (tMaster)
// Preceding table load:
Load
 Ky as WindRegion
 ,LkUp1 as LkUpVals3a
 ,LkUp2 as LkUpVals3b
 ,LkUp3 as LkUpVals3c
 Resident tRef;