7 Replies Latest reply: Oct 31, 2017 5:01 AM by Mark Little RSS

    Noconcatenate

    ramesh konda

           Hi I'm Facing weird behavior / any mistake in my writing. Below is how it looks like.

       

      LIB CONNECT TO 'Impaladb';

      LOAD aa,

                bb,

                cc;

      SQL SELECT aa,

                            bb,

                            cc

      FROM IMPALA.dba.'table1';

       

      LIB CONNECT TO 'Impaladb';

      NoConcatenate

      LOAD aa,

                ee,

                ff;

      SQL SELECT aa,

                            ee,

                            ff

      FROM IMPALA.dba.'table1';

       

      After loading, I'm able to see the Join between the tables in Data model, how to restrict the Join.

       

      --Rams

        • Re: Noconcatenate
          ramesh konda

          Sorry the second one is Table2.

            • Re: Noconcatenate
              Chris Casby

              Hi Ramesh,

               

              Qlik will associate the tables since they share the field 'aa'.  To generate 2 tables that are not associated, amend your script so 'aa' is not a shared field.  Simple fix as such should work:

               

              LIB CONNECT TO 'Impaladb';

              LOAD aa,

                        bb,

                        cc;

              SQL SELECT aa,

                                    bb,

                                    cc

              FROM IMPALA.dba.'table1';

               

              LIB CONNECT TO 'Impaladb';

               

              LOAD aa as AA_table2,

                        ee,

                        ff;

              SQL SELECT aa,

                                    ee,

                                    ff

              FROM IMPALA.dba.'table1';

               

              Just remember that the 'aa' field in Table 2 will be referenced as AA_table2. (Or whatever you choose to name the field. )

               

              An autoconcatenate will only occur if two loaded tables have the same fields.  No need to use Noconcatenate, as these two tables will not autoconcatenate, as they have different fields.

            • Re: Noconcatenate
              Mark Little

              HI,

               

              I am not a 100% sure I follow.

              But if you would like to load both tables without joining you just need to alias one of the joining field. Like below.

               

              LIB CONNECT TO 'Impaladb';

              LOAD aa,

                        bb,

                        cc;

              SQL SELECT aa,

                                    bb,

                                    cc

              FROM IMPALA.dba.'table1';

               

              LIB CONNECT TO 'Impaladb';

              NoConcatenate

              LOAD aa          AS AAT1,

                        ee,

                        ff;

              SQL SELECT aa,

                                    ee,

                                    ff

              FROM IMPALA.dba.'table1';

               

              I would normally advise adding table name before the load i.e. Table1:

               

              Mark

                • Re: Noconcatenate
                  ramesh konda

                  Mark Thanks for the kind reply, Ya I have planned to do the same.

                   

                  But Issue was i have few many tables when i need to avoid the common column join and need to specify my join. Then what is the use of Noconcatenate in front of LOAD|SELECT statement. I feel there is no Use of Noconcatenate its just limited.

                    • Re: Noconcatenate
                      Mark Little

                      HI,

                       

                      NoConcatenate is used to stop the auto concatenation of two table when the they have the same field names.

                      The most common use I find is when I load source data and then want to start doing further data manipulation to the table

                       

                      Mark

                  • Re: Noconcatenate
                    Andrea Gigliotti

                    OR

                     

                    Qualify '*';

                     

                    LIB CONNECT TO 'Impaladb';

                    LOAD aa,

                              bb,

                              cc;

                    SQL SELECT aa,

                                          bb,

                                          cc

                    FROM IMPALA.dba.'table1';

                     

                    LIB CONNECT TO 'Impaladb';

                    LOAD aa,

                              ee,

                              ff;

                    SQL SELECT aa,

                                          ee,

                                          ff

                    FROM IMPALA.dba.'table2';