Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
camilo
Contributor III
Contributor III

How can I avoid Sync in this example?

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!

12 Replies
Not applicable

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

Not applicable

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.

Not applicable

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);

Not applicable

Hi,

Use  below one.

QUALIFY *;

Regards,

Antony.

camilo
Contributor III
Contributor III
Author

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.

camilo
Contributor III
Contributor III
Author

Here is a table example:

TABLE 2



FechaIDID_CategoriaMargenPMesVentaP
40638L00110060,02105447440,192956297
40638L00110070,0032314440,013407976
40638L00111010,01065069340,071221895
40638L00111020,01935295240,236498163

TABLE 1






AñoCosto Venta $Departamento SAPDiaIDLocal SAPMesUnidades VendidasVenta Neta $
2011-0,000346ENVASES40717L001      CORONEL610,000336134
2011-0,000365ENVASES40698L001      CORONEL610,000336134
2011-0,0048PILETAS Y PARRILLAS40721L001      CORONEL640,006354622
2011-0,000692ENVASES40718L001      CORONEL620,00067227
2011-0,015634ELECTRO HOGAR40721L001      CORONEL620,020739496
2011-0,00039ENVASES40712L001      CORONEL610,000336134
camilo
Contributor III
Contributor III
Author

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).

Not applicable

Hi,

Please send an example application.

camilo
Contributor III
Contributor III
Author

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