3 Replies Latest reply: Jun 12, 2012 5:25 AM by Miguel Angel Baeyens de Arce RSS

    Help with something simple

      Hi All,

       

      Thanks in advance for any help given.

       

      I've had my initial trianing and used Qlikview a bit but still struggle to understand some simple ideas.

       

      My Problem

      Lets say I have 1 table called 'author' and another called 'report'. Each report will have an 'author1' but in some cases the report will also have an 'author2'. I connect to my sql database, import the tables fine and initially I import the 'author1' column as 'authorid' so it links directly with the primary key in the 'author' table. The problem here is that I also want the application to show reports for which the selected author is not just the 'author1' but also the 'author2'.

       

      I presume that I should not have actually imported the 'author1' column as 'authorid' but instead used an expression to say that the 'author1' value is referring to the 'authorid' value in the 'author' table. I could then pretty much use the same expression to link the 'auhor2' value.

       

      Thanks again,

       

      Dan

        • Re: Help with something simple
          Miguel Angel Baeyens de Arce

          Hi Dan,

           

          I'd say it depends on the charts you want to use. You can either join the "master" Author table to the Report table twice, using Author1 and Author2 as AuthorID respectively, or you can load the Author table twice, once renaming AuthorID to Author1 and the other to Author2, so you hace two author tables.

           

          Does that make sense?

           

          Miguel

            • Re: Help with something simple

              Hi Miguel,

               

              Thanks for the response.

               

              Yes that all sounds good.

               

              So is there nothing which I can do with the data after importing it rather than altering what I am importing? Sorry to be awquard but as I'm sure you can imagine, I am only explaining a small part of the application.

               

              Thanks,

               

              Dan

                • Re: Help with something simple
                  Miguel Angel Baeyens de Arce

                  Hi Dan,

                   

                  There are several ways of loading data from one table into another: mapping tables, joins, concatenates... once you have already loaded the date, of course. The LOAD part allows you to control what is put into QlikView and the SQL what are you pulling from the data source. In some cases you will need to denormalize data, which uses a bit more space but increases performance.

                   

                  In some cases, depending on hardware, network traffic, memory and CPU usage of RDBM or DWH... you can do some of these changes (say, joins) in the same SQL statement, but this usually loads unnecessarily the transactional and it all depends on the driver. And some things cannot be done in SQL.

                   

                  In the end, QlikView has its own rules, and one of them is that tables link only when they share name fields, so renaming is quite usual when loading data into QlikView.

                   

                  Hope that makes sense.

                   

                  Miguel