6 Replies Latest reply: Mar 21, 2012 6:30 PM by Henric Cronström RSS

    Resident Anomoly

      I have an interresting thing happening when I load a table (FACT_Temp) and left join another a table (STATUS). What I want to do is Resident Load a table (FACT) from FACT_Temp. The problem is it works perfectly when only the original fields from FACT_Temp are used. When I try to Resident Load it with the field added by the Left Join (from STATUS) the table (FACT) does not load. Anyone got an idea why that would be? I have attached a sample of what I mean.

        • Re: Resident Anomoly
          Sokkorn Cheav

          Hi,

           

          Let try this script:

          "Fact_Temp":
          LOAD * INLINE [
              CODE, DESCRIPTION
              1, First
              2, Second
              3, Third
              4, Fourth
          ];
          
          
          Left Join (Fact_Temp)
          LOAD * INLINE [
              CODE, STATUS
              1, Active
              2, Inactive
              3, Active
              4, Active
          ];
          
          "Fact":
          LOAD
              CODE AS [Code2], DESCRIPTION, STATUS
              //When STATUS is left out, the table FACT is shown
          Resident 
              Fact_Temp; 
          
          Drop Table Fact_Temp;
          

          Just rename one field in resident load (Ex. CODE AS [Code2])

           

          Regards,

          Sokkorn

            • Re: Resident Anomoly

              Hi Sokkorn,
              That worked, thank you very much. Is there a logical reason why you have to rename a field before you can do that or is that a work-around you figured out?

                • Re: Resident Anomoly
                  Sokkorn Cheav

                  Hi,

                   

                  I face the same issue since last year. Can find solution, but still don't know the root cause.

                   

                  Regards,

                  Sokkorn

                  • Re: Resident Anomoly
                    Celambarasan Adhimulam

                    Hi,

                         I think its because of two tables gets concatenated because QV automatically concatenates two tables which has same number of fields with same field names.NoConcatenate will help you.

                    Check with this

                         "Fact_Temp":
                    LOAD * INLINE [
                        CODE, DESCRIPTION
                        1, First
                        2, Second
                        3, Third
                        4, Fourth
                    ];


                    Left Join (Fact_Temp)
                    LOAD * INLINE [
                        CODE, STATUS
                        1, Active
                        2, Inactive
                        3, Active
                        4, Active
                    ];

                     

                    NoConcatenate
                    "Fact":
                    LOAD
                        CODE, DESCRIPTION, STATUS
                        //When STATUS is left out, the table FACT is shown
                    Resident
                        Fact_Temp;

                    Drop Table Fact_Temp;

                     

                    Celambarasan

                      • Re: Resident Anomoly

                        I thought so too initially - that is why I put in the drop satement (for the temp table) but with the same result. I am going to log it with QlikTech support and see whether it is a bug. Will let you know!

                          • Re: Resident Anomoly
                            Henric Cronström

                            Celambarasan is right. It is not a bug - it is a feature. QlikView concatenates the tables unless you have different sets of fields. The drop statement does not affect anything since it happens after the final load statement.

                             

                            Use NoConcatenate or add a dummy field in the temp table, e.g.: 'dummy' as DummyField.

                             

                            /HIC