2 Replies Latest reply: Jun 12, 2013 8:15 PM by Preciliano Fausto RSS

    query using resident tables

      That way you can make a query using resident tables and SQL tables?

      Example:

          CXC_Historico:
             SQL select Id_doc, date_doc, amount_doc, id_customer, id_country
                       from CXC_historico_movtos;
        
         MG_country:
            SQL select id_country, name_country
                       from mg_countries;

          QV_example_1:
             SQL select ctes.id_customer, name_customer, amount_doc, date_doc
                        from CXC_customer ctes
                               CXC_Historico resident his inner join on ctes.id_customer = his.id_customer;

           QV_example_2:
              select h.*,name_country
                 from CXC_Historico h MG_country inner join c on h.id_country = c.id_country;

      These queries are examples only, using residents tables.

        • Re: query using resident tables
          Gysbert Wassenaar

          You cannot use the select keyword to load data from a resident table, but need to use the load keyword instead. That also means that the sql join construct cannot be used. In a Qlikview join it's not possible to specify the fields that should be used for the join. Instead the join uses the fields that have the same names in both tables.

          • Re: query using resident tables

            excuse me, I had a error in the examples


            That way you can make a query using resident tables and SQL tables?

             

            Example:

             

            CXC_Historico:

                SQL select Id_doc, date_doc, amount_doc, id_customer, id_country

              from CXC_historico_movtos;

              

            MG_country:

               SQL select id_country, name_country

              from mg_countries;

             

            QV_example_1:

                SQL select ctes.id_customer, name_customer, amount_doc, date_doc

               from CXC_customer ctes

               inner keep resident CXC_Historico his  on ctes.id_customer = his.id_customer;

             

            QV_example_2:

               select h.*,name_country

                from CXC_Historico h inner keep resident MG_country c on h.id_country = c.id_country;


            These queries are examples only, using residents tables.