Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vardhan1305
Contributor II
Contributor II

Need to create a column

Temp:

month         total              ROP               Current

may2018         50              May19                   200

may2018          60              May 19                  200

may2018         70               May19                    200

may2018         100              May19                   200

may 2019         45              May19                      200

may 2019         50              Aug18                    20

may 2019         75               Aug18                    20

may 2019          200            Aug18                     20

aug2018           75                Aug18                   20

aug2018           34                 Aug18                     20

aug2018            20                Aug18                     20



Above is the table 'Temp' , I need to create a new column 'Current' in it where it should display the last total value of every month  with the respective year.


Can you help me out. Thanks.


4 Replies
jyothish8807
Master II
Master II

Hi Harsha,

Please refer the attached.

Br,

KC

Best Regards,
KC
jyothish8807
Master II
Master II

Capture.PNG

Best Regards,
KC
sunilkumarqv
Specialist II
Specialist II

please  create new logical table after script

LOAD month,lastvalue(total) as Current Resident temp Group by month;

sunny_talwar

Another option

Table:

LOAD Date(Date#(month, 'MMMYYYY'), 'MMMYYYY') as month,

total,

Date(Date#(ROP, 'MMMYY'), 'MMMYYYY') as ROP;

LOAD * INLINE [

    month, total, ROP

    may2018, 50, May19

    may2018, 60, May19

    may2018, 70, May19

    may2018, 100, May19

    may2019, 45, May19

    may2019, 50, Aug18

    may2019, 75, Aug18

    may2019, 200, Aug18

    aug2018, 75, Aug18

    aug2018, 34, Aug18

    aug2018, 20, Aug18

];


Left Join (Table)

LOAD month as ROP,

LastValue(total) as Current

Resident Table

Group By month;

Capture.PNG