Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
annabergendal
Partner - Creator
Partner - Creator

Joining two tables in order to make peek

Hopefully someone can help me out.

I want to join two tables, but don't know how to get the result I want. The tables look something like this:

TableA

Datum

2013-01

2013-02

2013-03

...

2014-05

TableB

Datum          Quantity          Material

2013-03        10                   x  

2013-03        15                   y  

2013-06        5                    x 

2013-06        2                    y

I want a joined table like:

JoinedTable

Datum          Quantity          Material

2013-01        -                      x

2013-02        -                      x

2013-03        10                   x  

2013-04        -                      x

2013-05        -                      x

2013-06        5                     x

2013-01        -                      y

2013-02        -                      y

2013-03        15                   y

2013-04        -                      y

2013-05        -                      y

2013-06        2                     y

 

The reason I want to join like this is because I want to fill in the holes later with peek, so if NULL fill in the latest valid value... 

Can anyone advice me how to proceed with this? Can I even DO this?? Thanks!

4 Replies
maxgro
MVP
MVP

PFA

1.png

annabergendal
Partner - Creator
Partner - Creator
Author

Thanks! That's great...

Now how can I sort the table in the script by Material, so that it looks like in your table. Tried with Order By but it doesn't seem to work... It order by Datum, which means I cannot do the peek thing I would like...

maxgro
MVP
MVP

you can order by when you read from an already in memory table (load ... resident....)

so add

TableC:

noconcatenate load

  *

Resident

TableA

order by ...;

drop table TableA;

annabergendal
Partner - Creator
Partner - Creator
Author

Thanks a lot!