0 Replies Latest reply: Dec 7, 2015 4:42 AM by Alexander Steinhart RSS

    QlikView SQL Select for SAP where Value in other Table

    Alexander Steinhart

      Hello,

      I load data from SAP in QlikView.

       

      Table1:

      SQL Select

        KNUMH,

           ...

      from A004

      where DATAB  <=  '$(vdateToDay)' and .............. ;

       

      This part works well.

       

      Now I'd like to add an other table. But only if the key "KNUMH" have the same value.

      So I use a left join.

       

      left join (Table1)

      SQL select  MANDT,

           KNUMH,

          

           ...

       

      from KONP;

       

      This works but not very fast, because in KONP are 100 000 000 records and it load all records before the left join reduced the values. In Table1 I had the same problem, but after I add the "Where"-filter it works well.

      Now I like to Select only the records where KNUMH is in Table1.

      I try this way and some variants I find in the community:


      SQL select  MANDT,

           KNUMH,

                ...

      from KONP where  and KNUMH in (Select KNUMH FROM Table1);

       

      But it doesn't work. I like to use Table1 for the selection, because Table1 is filtered.


      Thank you for your support.


      Regards

      Alex