Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ecabanas
Creator II
Creator II

Put values in previous lines

HI

I have this table without the To field in null.

ItemIdRate_IdRateFromTo
1036267810362678-423702,9901/01/2016
1036267810362678-424153,0815/02/2016
1036267810362678-424163,0816/02/2016
1035676710356767-423706,8201/01/2016
1035676710356767-423956,3226/01/2016

I want to close the lines where there is a new one and if there is no new, T0= Today()

2016-07-08_12h55_56.png

Many thank's

Eduard

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Table:

LOAD * INLINE [

    ItemId, Rate_Id, Rate, From

    10362678, 10362678-42370, 2.99, 01/01/2016,

    10362678, 10362678-42415, 3.08, 15/02/2016,

    10362678, 10362678-42416, 3.08, 16/02/2016,

    10356767, 10356767-42370, 6.82, 01/01/2016,

    10356767, 10356767-42395, 6.32, 26/01/2016

];

FinalTable:

LOAD *,

  Date(If(ItemId = Previous(ItemId), Previous(From), Today())) as To

Resident Table

Order By ItemId, From desc;

DROP Table Table;


Capture.PNG

View solution in original post

3 Replies
sunny_talwar

Try this:

Table:

LOAD * INLINE [

    ItemId, Rate_Id, Rate, From

    10362678, 10362678-42370, 2.99, 01/01/2016,

    10362678, 10362678-42415, 3.08, 15/02/2016,

    10362678, 10362678-42416, 3.08, 16/02/2016,

    10356767, 10356767-42370, 6.82, 01/01/2016,

    10356767, 10356767-42395, 6.32, 26/01/2016

];

FinalTable:

LOAD *,

  Date(If(ItemId = Previous(ItemId), Previous(From), Today())) as To

Resident Table

Order By ItemId, From desc;

DROP Table Table;


Capture.PNG

ecabanas
Creator II
Creator II
Author

Your aree sooooooo big

sunny_talwar

Why am I so big my friend