Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, all .
I cannot find the answer to this in the manual. Please tell me why the following code loads test_table_1 twice instead of test_table_1 and then test_table_2?
test_table_1:
sql select ...
...;
test_table_2:
sql select ...
...;
What am I missing? Many thanks in advance.
If the two select statements return the same number of columns with the same names then the results of the second select statement are automatically added to the first table. That's the default behavior of Qlikview. If you don't want that you have to specify the noconcatenate keyword above the second select statement or use the Qualify keyword so the fieldnames are prefixed with the table name thus making them unique.
test_table_1:
sql select ...
...;
Noconcatenate // or Qualify * ;
test_table_2:
sql select ...
...;
Note, this will result in a big synthetic key and probably performance problems. It's better to concatenate the two results and create a field to store where the data came from:
test_table_1:
sql select ..., 'fromsource1' as Source
...;
sql select ..., 'fromsource2' as Source
...;
Kevin,
It looks like you are missing LOAD statements. Try this:
test_table_1:
Load
...
;
sql select ...
...;
test_table_2:
Load
...
;
sql select ...
...;
Kevin,
Not enough information. And, it is unlikley that it has anyhting to do with the preceeding load. Can you provide a little more info? Maybe upload an example?
Regards,
Michael
Kevin,
Would you please provide the complete load script?
Thanks,
Aji Paul.
If the two select statements return the same number of columns with the same names then the results of the second select statement are automatically added to the first table. That's the default behavior of Qlikview. If you don't want that you have to specify the noconcatenate keyword above the second select statement or use the Qualify keyword so the fieldnames are prefixed with the table name thus making them unique.
test_table_1:
sql select ...
...;
Noconcatenate // or Qualify * ;
test_table_2:
sql select ...
...;
Note, this will result in a big synthetic key and probably performance problems. It's better to concatenate the two results and create a field to store where the data came from:
test_table_1:
sql select ..., 'fromsource1' as Source
...;
sql select ..., 'fromsource2' as Source
...;
Thanks G.W. That's what I needed. Still a little rusty as it has been a few years. Thanks again!
And thanks to others for replying also :-).