Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
paul_scotchford
Valued Contributor

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

Tags (4)
1 Solution

Accepted Solutions

Re: Not all tables loaded by LOAD Script

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

2 Replies

Re: Not all tables loaded by LOAD Script

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
Valued Contributor

Re: Not all tables loaded by LOAD Script

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;

Community Browser