Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone, I hope you can help me. I'm trying to join 3 tables. In SQL should be this way:
[Item Ledger Entry] INNER JOIN [Item] ON [Item Ledger Entry].[Item No_] =
[Item].No_ INNER JOIN [Tariff Number] ON
[Item].[Tariff No_] = [Tariff Number].[No_]
INNER JOIN [Value Entry] ON [Item Ledger Entry].[Entry No_] = [Value Entry].[Item Ledger Entry No_]
The script I've done is the following:
Intrastat:
LOAD
YEAR("Posting Date") As Año,
MONTH("Posting Date") As Mes,
"Item No_" As "Nº Producto",
DATE("Posting Date",'DD/MM/YYYY') As "Fecha",
"Document No_" As "Nº Documento",
"Country_Region Code" As "Código País",
"Specie" As "Especie",
"Variety" As "Variedad",
"Category" As "Categoría",
"Caliber" As "Calibre",
"Country_Region of Origin Code" As "Código País Origen",
"Tariff No_" As "Código Arancelario",
"Quantity" As "Cantidad",
IF("Quantity"<0,'Envío','Recepción') AS "Tipo Movimiento";
SELECT *
FROM "$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item Ledger Entry" JOIN
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item" ON
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item Ledger Entry" ."Item No_" =
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item"."No_" JOIN
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Tariff Number" ON
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item"."Tariff No_" =
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Tariff Number"."No_";
[/Code]
Running this I have no trouble just because all tha loaded fields belong to the first table"Item Ledger Entry".
But If I include the field "Description" that belongs to the table "Tariff Number" like this:
"Quantity" As "Cantidad",
IF("Quantity"<0,'Envío','Recepción') AS "Tipo Movimiento",
"Description As "Descripción";
SELECT *
FROM "$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item Ledger Entry" JOIN
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item" ON
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item Ledger Entry" ."Item No_" =
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item"."No_" JOIN
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Tariff Number" ON
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Item"."Tariff No_" =
"$(_DBName)". "$(_DBOwner)". "$(_CompanyName)$Tariff Number"."No_";
I get an error. So the questions is where part of this script do I have to define the fields of the other tables that are part of the query?
Thanks in advance
</body>
You are missing a " in the line
"Description As "Descripción";
Even though the double quotes are unnecessary.
Do a Load * over you SQL Statement to see what columns QlikView is importing.
Regards.
You are missing a " in the line
"Description As "Descripción";
Even though the double quotes are unnecessary.
Do a Load * over you SQL Statement to see what columns QlikView is importing.
Regards.
You're right Thanks a lot