Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

juan_patrick
Contributor

Join tables

Hi! I put the problem in the attached file, and in it its what I need:

There is a table that have events, thats events has owner but only I can see it when the event is "TRANSFERIR"

In the excel its clearly; thank you!!

Tags (4)
5 Replies
MCampestrini
Valued Contributor

Re: Join tables

Hi Juan

Read this:

How to populate a sparsely populated field

Márcio

Márcio Rodrigo Campestrini
juan_patrick
Contributor

Re: Join tables

Márcio, the problem is tha i dont have the first and last value for each ticket!

anbu1984
Honored Contributor III

Re: Join tables

Try this

Initial:

Load ticket,actividad,fechainicio,fechafin,

If( IsNull(grupodesde) Or grupodesde = '',If(Previous(grupohasta) = '',Peek(grupoactual),Previous(grupohasta)),

grupodesde) As grupoactual, RowNo() As RowNo;

Load * Inline [

ticket,actividad,fechainicio,fechafin,grupodesde,grupohasta

1,inicio,1/20/2010,1/20/2010,,

1,adjunta,1/20/2010,1/20/2010,,

1,transferir,1/21/2010,1/22/2010,g1,g2

1,actualiza,1/22/2010,1/22/2010,,

1,resuelto,1/22/2010,1/22/2010,,

1,transferir,1/22/2010,1/22/2010,g2,g3

1,reanudar,1/22/2010,1/22/2010,,

1,resuelto,1/22/2010,1/22/2010,, ];

NoConcatenate

Final:

Load ticket,actividad,fechainicio,fechafin,

If( IsNull(grupoactual) Or grupoactual = '',Peek(grupoactual),grupoactual) As grupoactual Resident Initial Order by RowNo desc;

Drop table Initial;

juan_patrick
Contributor

Re: Join tables

Its nearest!

Please see the attached file (example2), the NSD = HD398723, the data correct is the column OK

anbu1984
Honored Contributor III

Re: Join tables

Try this

Initial:

Load ACTIVIDAD,

     NSD,

     TIEMPO_TOTAL,

     FechaInicio,

     FechaRes,

     If( NSD <> Previous(NSD),GRUPODESDE,

If( IsNull(GRUPODESDE) Or GRUPODESDE = '',If( IsNull(Previous(GRUPOHASTA)) Or Previous(GRUPOHASTA) = '',Peek(grupoactual),Previous(GRUPOHASTA)),

GRUPODESDE)) As grupoactual, RowNo() As RowNo;

LOAD ACTIVIDAD,

     NSD,

     TIEMPO_TOTAL,

     FechaInicio,

     FechaRes,

     GRUPODESDE,

     GRUPOHASTA,

     GRUPO_ACTUAL,

     FLAGT,

     OK

FROM

(biff, embedded labels);

NoConcatenate

Final:

Load ACTIVIDAD,

     NSD,

     TIEMPO_TOTAL,

     FechaInicio,

     FechaRes,

If( IsNull(grupoactual) Or grupoactual = '',Peek(grupoactual),grupoactual) As grupoactual,

RowNo Resident Initial Order by RowNo desc;

Drop table Initial;