Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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;
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.
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
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.
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.
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.