Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator III
Creator III

Loading data from DB

Hi,

Is it good to do select * from table or the ctrl + select required field while pulling data from select wizard.

I think that using preceding load and then removing unncessary fields from preceeding load is enough to avoid unncessary fields.

Eg1-

Table:

LOAD

field1

field2

field3;

SQL SELECT *

FROM "database".dbo.tblSales;

Eg2-

Table:

LOAD

field1

field2

field3;

SQL SELECT field1, field2, field3

FROM "database".dbo.tblSales;

So, could you tell me which example is best from the above.

Regards,

Suraj

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Yes script is longer but this is not a problem, you may write

Load field1, field2 .... From

instead of

load

field1,

field2

..

from

But it is better to write needed fields and control their names.

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Performances are the same but it is better the second in which you list all fields so you may control mistakes or fields with the same name.

If you don't need to compute fields it is enough

SELECT field1, field2, field3

FROM "database".dbo.tblSales;

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The second option is better since it will pull less data from the database over your network. The second option only retrieves the fields you will actually load in the qlikview document.


talk is cheap, supply exceeds demand
surajap123
Creator III
Creator III
Author

Thanks for all the valuable inputs !!

However, I believe that the data model only loads the required fields even using the Eg1, as we can control the required fields in Preceding load. Am I Right?

I understand that, less data will be pulled over the network, if I go with second option. However showing all fields in select statement eats up load of space in script editor. What I can do to avoid this problem?

Regards,

Suraj

alexandros17
Partner - Champion III
Partner - Champion III

Yes script is longer but this is not a problem, you may write

Load field1, field2 .... From

instead of

load

field1,

field2

..

from

But it is better to write needed fields and control their names.

Not applicable

Whilst not "performance-best" - I use select * from... even though I may only require 3 fields in the LOAD script, at times my business will require more to be queried.

I call if "futureproofing" the application.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

When you use the Create Select Statement dialog window you have some options to format the script: Column, Row or Structured. You can use these to pick the format that is most useful to you. You can for example choose Structured and then put the three fields you need at a separate line and comment out the rest:

SQL Select Field1, Field2, Field3

// Field4, ..., Field89

// Field90, ..., Field117,

FROM MyTable;

In the script editor you can simply select a block of script lines, right click and choose Comment to comment out the selected lines.


talk is cheap, supply exceeds demand