Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
paul_scotchford
Specialist
Specialist

Not all tables loaded by LOAD Script

Hi

I am trying to do a LOAD (using T-SQL) to load 2 tables, however only one table shows up in the Model.

I have tried many different combinations to the script but still end up with the 1st table only.

BaseMeasures:


LOAD * ;     

SQL select  BaseMeasures.MeasureName
                   ,BaseMeasures.MeasureCalculation
         from
                    dbo.BaseMeasures ;

DerivedMeasures1:


LOAD *;

SQL select DerivedMeasures.MeasureName
                  ,DerivedMeasures.MeasureCalculation
            from
                    dbo.DerivedMeasures;

The second table does not show in the model diagram, it will LOAD if I rename the fields to something different, but does that not defeat what QV is about (i.e. Associative)? These tables are not expected to form associations for the user, they are for the developer to use as we keep Measures and their calcs in a business dictionary on SQLServer (2012)

Thanks is advance for responses

Paul

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The rows from both tables are being loaded. They are being concatenated into a single table due to QV's auutomatic concatenation feature. If the field list in a LOAD has exactly the same field list as an existing table, it will be concatenated to the existing table.

If you want two tables, you can either use the NOCONCATENATE prefix on the second load, or use different names. Using the QUALIFY *; statement is an easy way to generate distinct names -- they will then use the tablename as a prefix.

-Rob

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The rows from both tables are being loaded. They are being concatenated into a single table due to QV's auutomatic concatenation feature. If the field list in a LOAD has exactly the same field list as an existing table, it will be concatenated to the existing table.

If you want two tables, you can either use the NOCONCATENATE prefix on the second load, or use different names. Using the QUALIFY *; statement is an easy way to generate distinct names -- they will then use the tablename as a prefix.

-Rob

paul_scotchford
Specialist
Specialist
Author

Rob, Once again, many thanks for your solution to my question.

I have included a code stub of my actual implementation for others to reference using your solution.

QUALIFY *;
DynamicVariables:
LOAD              
 
ObjectName,
  ObjectValue ;
SQL select
            StaticVariables.ObjectName
           ,StaticVariables.ObjectValue
from
         dbo.StaticVariables;