Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

inner keep

Hi,

I am trying to reduce loads by using INNER KEEP (<table>).

(Inner joins  which reduce number of rows loaded for subsequent tables).

Tried all kind of syntax combinations, but its not working.

Please note that I am loading from SQL, not qvd.

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

This works, but its slow.  (the INNER KEEP is not needed)

Table1:

LOAD Account AS PatientAccountID,

    
PatientClass,

    
ADDate,

    
Discharged,

    
LOS,

    
Provider,

    
PrimaryDX,

    
PrimaryProcedure,

    
ECD,

    
NerveBlock,

    
FPxDate

     

FROM

$(vPathName)xxxxyyyyy.xls

(
biff, embedded labels, table is KWMatch$);





Table2:

INNER KEEP (Table1)

LOAD   [PatientAccountID]

      ,
[ObjectID] AS PatientVisitOID

      ,
[VisitDSC]

      ,
[StartDTS]

      ,
[StartDTS] AS VisitDate

       ,
[EndDTS]

       ,
[VisitTypeCD]

      ,
[CategoryDSC]

      ,
[FinancialClassCD]

      ,
[UnitContactedNM]

      ,
[DischargeDispositionDSC]

      ,
[AccommodationTypeCD]

      ,
[DischargeToDSC]

      ,
[AdmitReasonCD]

      ,
[PreVisitDTS]

      ,
[AdmitSourceDSC]

      ,
[EDWLastModifiedDTS]

WHERE Exists(PatientAccountID);



     
SQL SELECT *

FROM SQL.DBO.zzzzzz
where [IsDeletedFLG] = 0 and DatePart(Year, [StartDTS]) = 2014

order by ObjectID DESC;

View solution in original post

14 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Select A.* from TableA as A

inner join TableB as B on A.fld1 = B.fld1

let me know

Anonymous
Not applicable
Author

Will check it out.

I thought the “ON” is only a SQL syntax, not a QlikView scripting.

Thanks

alexandros17
Partner - Champion III
Partner - Champion III

Yes it is, I thought you need help on SQL (as you said)

You can use in the script the code I sent to you.

Anonymous
Not applicable
Author

Hi Alessandro,

I am loading a list of items from Excel, then I want to load from a SQL table (20 million rows), only the rows that include these items.

So I thought of having a Qlikview “INNER KEEP” in the script, to reduce the rows loaded.

J

alexandros17
Partner - Champion III
Partner - Champion III

So you have to

1) load the Excel list

2) LEFT Join the table from sql

in this way only records matchink the Excel list will be taken (no way to reduce data before loading the sql)

Anonymous
Not applicable
Author

Yes, that’s what I am realizing.

However, it can be done with EXISTS

Not applicable
Author

Try this one.


Table1:

Select * from Table1;

Table2:

Inner keep(Table1)

Select * from Table2;

If its not working, please post the error which you are getting.

alexandros17
Partner - Champion III
Partner - Champion III

Yes but the Whole set of data must be read from sql ... where exists ...

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

I think you should look into using EXISTS function in your WHERE clause