Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
CGJA
Creator II
Creator II

unir dos tablas

tengo dos tablas de las cuales 3 coinsiden como las marco a color, y en la segunda tabla pongo unos asteriscos.

quiero que si considen esos 3 campos me mande el dato del de la segunda tabla

Table1:

LOAD

user as _iduser,

     equip as _idequipment,

     idpack,

     pack as Paquete,

     code,

     study as Analito,

     Left(study,9) as AnalitoClave,

     count as Cantidad,

     price as Precio,

     cash as Subtotal2,

     done,

     status,

     count*price as Subtotal,

     date(DayStart(timeRegister)) as FechaEmision1,

     date(timeUpdate) as FechaEnvioIntelisis,

     date(timeStart) as FechaInicioConteo,

     date(DayStart(timeEnd)) as FechaEmision,

     idcount,

     Upper(idunit) as Cliente,     

     idunit&'-'&if (idsuc='0','',idsuc) as ClienteEnviarA,

     idunit&'-'&code as Key,

     user

FROM

(qvd)Where date(timeRegister) >= '01/01/2012' and status='-1' and done= '-1' ;

Table2:

LOAD

    _idequipment,

    _idsegment,

     _idstudy, ***********

     code

   

FROM

(qvd);

Espero me puedan apoyar

1 Reply
hector_munoz
Specialist
Specialist

Hola Jorge,

Prueba lo siguiente:

MAP_TABLE2:

MAPPING LOAD _idequipment & '|' & _idsegment & '|' & code    AS [MAP_TABLE2 Key],

                            _idstudy                                                              AS [MAP_TABLE2 Key]

FROM

(qvd);

Table1:

LOAD

user as _iduser,

     equip as _idequipment,

     idpack,

     pack as Paquete,

     code,

     study as Analito,

     Left(study,9) as AnalitoClave,

     count as Cantidad,

     price as Precio,

     cash as Subtotal2,

     done,

     status,

     count*price as Subtotal,

     date(DayStart(timeRegister)) as FechaEmision1,

     date(timeUpdate) as FechaEnvioIntelisis,

     date(timeStart) as FechaInicioConteo,

     date(DayStart(timeEnd)) as FechaEmision,

     idcount,

     Upper(idunit) as Cliente,    

     idunit&'-'&if (idsuc='0','',idsuc) as ClienteEnviarA,

     idunit&'-'&code as Key,

     user,

     ApplyMap('MAP_TABLE2', equip & '|' & pack & '|' & code, 'Sin Asignar')     AS [ID Study MAP]

FROM

(qvd)Where date(timeRegister) >= '01/01/2012' and status='-1' and done= '-1' ;

Espero que te sirva...

Saludos,

H