Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
yoganantha321
Creator II
Creator II

Loading a new column with another column

Hi  all,

I have a data set as like below:

YearSale
201410000
201515000
201620000
201730000

 

But I need a new column as like below:

YearSalePrevious Year Sale
2014100000
20151500010000
20162000015000
20173000020000

 

can anybody help in this!!!

 

Regards,

Yoga

Labels (2)
1 Solution

Accepted Solutions
syedabik
Partner - Contributor II
Partner - Contributor II

Hi, 

Try this:

Data:
Load * Inline
[
Year, Sale
2014, 10000
2015, 15000
2016, 20000
2017, 30000
];

Left Join
Load Year+1 as Year,
alt(Sale,0) as PreviousYear
Resident Data;

Capture.PNG

View solution in original post

2 Replies
teiswamsler
Partner - Creator III
Partner - Creator III

Hi Yoganantha

Try this expression

Rangesum( below( Sum( Sales), -1 ) )

Br.
Teis

syedabik
Partner - Contributor II
Partner - Contributor II

Hi, 

Try this:

Data:
Load * Inline
[
Year, Sale
2014, 10000
2015, 15000
2016, 20000
2017, 30000
];

Left Join
Load Year+1 as Year,
alt(Sale,0) as PreviousYear
Resident Data;

Capture.PNG