8 Replies Latest reply: Aug 5, 2011 2:10 AM by ionut biliuti RSS

    loading data

    ionut biliuti

      Hi everybody,

      I am very, very new in Qlik also in programming so please heave mercy :-)

       

      I have two table

       

      table1:

      val1, dep

      12 , aa    

      123, aa

      223, bb

      233, cc

       

      table2:

      dep, val2, val3

      aa,   122,  3939     

      bb,   124,  3439

      cc,   123,  wee9

      ee,   344,  3ejej

      xx,   556,  3lkm

       

      I need to load data from table2 only if val1=xxx

       

      Thanks a lot

        • loading data
          Sunil Chauhan

          i am not understand clearly but u can try it

          table1:

          load * inline [

          val1, dep

          12 , aa    

          123, aa

          223, bb

          233, cc

          ];

           

          table2:

          load * inline [

          dep, val2, val3

          aa,   122,  3939     

          bb,   124,  3439

          cc,   123,  wee9

          ee,   344,  3ejej

          xx,   556,  3lkm

          ];

           

           

          Load

          dep, val2, val3

          resisent tabe2 where dep='XX';

           

          drop table table2;

            • loading data
              ionut biliuti

              i want to put condition for field "val1" from table1

                • loading data
                  Sunil Chauhan

                  but there is no item like xxx in var1

                    • loading data
                      ionut biliuti

                      sorry, you have right

                       

                      condition is something like this: val1=223

                        • loading data
                          Sunil Chauhan

                          table1:

                          load * inline [

                          val1, dep

                          12 , aa    

                          123, aa

                          223, bb

                          233, cc

                          ];

                           

                          table2:

                          load * inline [

                          dep, val2, val3

                          aa,   122,  3939     

                          bb,   124,  3439

                          cc,   123,  wee9

                          ee,   344,  3ejej

                          xx,   556,  3lkm

                          ];

                           

                           

                          Tab3:

                          Load

                          dep,

                          val1 as val1_new

                          resident table1;

                          left join

                          Load

                          dep,

                          val2, val3

                          resisent tabe2 ;

                          Tab4:

                          Load

                          dep,

                          val2, val3

                          resident Tab3 where val1_new=123;

                           

                          drop tables table2, Tab3;

                            • loading data
                              ionut biliuti

                              i run this:

                               

                              table1:

                              load * inline [

                              val1, dep

                              12 , aa 

                              123, aa

                              223, bb

                              233, cc

                              ];

                               

                              table2:

                              load * inline [

                               

                              dep, val2, val3

                              aa,   122,  3939    

                              bb,   124,  3439

                              cc,   123,  wee9

                              ee,   344,  3ejej

                              xx,   556,  3lkm

                              ];

                               

                              Tab3:

                              Load

                              dep,

                              val1 as val1_new

                              resident table1;

                               

                              left join

                              Load

                              dep,

                              val2, val3

                              resident table2 ;

                               

                              Tab4:

                              Load

                              dep,

                              val2, val3

                              resident Tab3 where val1_new=123;

                               

                              drop tables table2, Tab3;

                               

                              but the result is only table1. If i comment drop tables i dont see tab4

                                • loading data

                                  Hi guy,

                                   

                                  When you create your table 4, you give the same name for the column than table 2. Qlikview will automatically join table 2 et table 4 because of that.

                                   

                                  you have to understand how QlikView store data in its model. Each time that you have 2 table with exactly the same column names then QlikView will automatically aggregate data and he will create only one table.

                                   

                                  i think that there is a command like noconcatenate if you want to see your table 4, try this :

                                   

                                  Tab4:

                                  noconcatenate Load

                                  dep,

                                  val2,

                                  val3

                                  resident Tab3 where val1_new=123;