Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I´m loading two tables but I´m getting syn tables ¿How can I avoid this?
LOAD [Local SAP],
[Id SAP] as ID,
[Departamento SAP] as Departamento,
Month(Dia) as Mes,
Year(Dia) as Año,
Dia as Fecha,
[Unidades Vendidas],
[Venta Neta $]/1000000 as Venta,
[Costo Venta $]/-1000000 as Costo
FROM
(qvd);
LOAD Fecha,
id_local_int as ID,
ID_Categoria,
Venta/1000000 as VentaP,
[Margen dia]/1000000 as MargenP,
Month(Fecha) as Mes,
Year(Dia) as Año,
FROM
(qvd);
Thanks!
Could you please upload a sample database for this two table. For the time being, you do not need to write
Month(Fecha) as Mes,
Year(Dia) as Año,
on the [PptoDetalle.qvd] table.
Message was edited by: lalmohan.behera
Hi Camilo ,
I think you are getting snc because you are using
[Id SAP] as ID, &
id_local_int as ID both are with same colomn name can you use one as Sap_ID & other one as Local_ID or try to change year alias in any one of the table .
If still you are getting sync tables can you tell me what are the colomn's u r getting in sync table .
thankyou
Meher.
Hi, Syn are generated when there are more than one same field names in two tables. Try following code. Hope it will remove syn.
LOAD [Local SAP],
[Id SAP] as ID,
[Departamento SAP] as Departamento,
Month(Dia) as Mes_venta,
Year(Dia) as Año_venta,
Dia as Fecha,
[Unidades Vendidas],
[Venta Neta $]/1000000 as Venta,
[Costo Venta $]/-1000000 as Costo
FROM
(qvd);
LOAD Fecha,
id_local_int as ID,
ID_Categoria,
Venta/1000000 as VentaP,
[Margen dia]/1000000 as MargenP,
Month(Fecha) as Mes,
Year(Dia) as Año,
FROM
(qvd);
Hi,
Use below one.
QUALIFY *;
Regards,
Antony.
I marked in bold the sync fields, I need them with the same names in both tables so I can use date or id filters that affects both tables.
If I dont do this when I click on one field such as Dia, I will only see the SAP table data an not the other table data (Fecha), the same happens with the ID field.
Here is a table example:
TABLE 2 | |||||
Fecha | ID | ID_Categoria | MargenP | Mes | VentaP |
40638 | L001 | 1006 | 0,021054474 | 4 | 0,192956297 |
40638 | L001 | 1007 | 0,00323144 | 4 | 0,013407976 |
40638 | L001 | 1101 | 0,010650693 | 4 | 0,071221895 |
40638 | L001 | 1102 | 0,019352952 | 4 | 0,236498163 |
TABLE 1 | ||||||||
Año | Costo Venta $ | Departamento SAP | Dia | ID | Local SAP | Mes | Unidades Vendidas | Venta Neta $ |
2011 | -0,000346 | ENVASES | 40717 | L001 | CORONEL | 6 | 1 | 0,000336134 |
2011 | -0,000365 | ENVASES | 40698 | L001 | CORONEL | 6 | 1 | 0,000336134 |
2011 | -0,0048 | PILETAS Y PARRILLAS | 40721 | L001 | CORONEL | 6 | 4 | 0,006354622 |
2011 | -0,000692 | ENVASES | 40718 | L001 | CORONEL | 6 | 2 | 0,00067227 |
2011 | -0,015634 | ELECTRO HOGAR | 40721 | L001 | CORONEL | 6 | 2 | 0,020739496 |
2011 | -0,00039 | ENVASES | 40712 | L001 | CORONEL | 6 | 1 | 0,000336134 |
In deed I´m getting sinc on those keys (ID), but I need them with the same name to connect the tables. And I need Month, Year in both tables else when I selecct one month or year only the data of one table will be sown (the table wich has the month and year fields on the script).
Hi,
Please send an example application.
Hi, I solved the problem concatenating the tables, I don´t know if that the best way but it´s working till now.
Thanks all for your help.
Camilo