Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone, thanks in advance for your help,
I think I'm misunderstanding something about how the syntax in QlikView works. I would like to know why the 2nd qvd 'CosttoServe_Sales' is loaded into the first QlikView table 'CosttoServe_TMA' when I'm indicating that it should be saved as 'CosttoServe_Fact'.
Thank you and regards.
(Image 1 - Code in which I want to create two separte tables from the qvds but both qvds are saved to the first table [I know the fields are called the same, I'm not interested for now in concating])
(Image 2 - Script that exemplifies what is happening)
(Image 3 - Only the CosttoServe_TMA table is created in QV)
Since the fieldnames within the two tables are exactly the same, they are getting auto-concatenated.... to check, you can look at the table viewer and you will find that the number of rows in your single table will be the sum of rows from both the table. I wonder why would you not want to concatenate because not concatenating them will create synthetic keys.... but in case you want to use these tables for further manipulation and want to keep them separate, you can use NoConcatenate keyword
CosttoServe_TMA:
LOAD [Date Key],
[Customer ID],
[Product ID],
Item,
Value
FROM CosttoServe_TMA.qvd (qvd);
CosttoServe_Fact:
NoConcatenate
LOAD [Date Key],
[Customer ID],
[Product ID],
Item,
Value
FROM CosttoServe_Sales.qvd (qvd);
Since the fieldnames within the two tables are exactly the same, they are getting auto-concatenated.... to check, you can look at the table viewer and you will find that the number of rows in your single table will be the sum of rows from both the table. I wonder why would you not want to concatenate because not concatenating them will create synthetic keys.... but in case you want to use these tables for further manipulation and want to keep them separate, you can use NoConcatenate keyword
CosttoServe_TMA:
LOAD [Date Key],
[Customer ID],
[Product ID],
Item,
Value
FROM CosttoServe_TMA.qvd (qvd);
CosttoServe_Fact:
NoConcatenate
LOAD [Date Key],
[Customer ID],
[Product ID],
Item,
Value
FROM CosttoServe_Sales.qvd (qvd);
Since you are loading the identical Column names from your second qvd, by default, qlikview concatenates the second table to the first table.
You could prevent this by using the keyword NoConcatenate before the second load statement.
Hth
Sasi