Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
krishna20
Specialist II
Specialist II

Previous function

Hi Folks,

I am having date and I need New date fields's data should be like below. How can I achieve this at script level as a new field using peek or previous functions.

DateNew Date
01-09-201802-09-2018
02-09-201803-09-2018
03-09-201804-09-2018
04-09-201905-09-2018
05-09-201806-09-2018
06-09-201807-09-2018
07-09-2018-

Regards

krishna

4 Replies
shiveshsingh
Master
Master

Hi

Try this

T:

load Date#(Date,'DD-MM-YYYY') as Date;

load * inline

[Date

01-09-2018,

02-09-2018,

03-09-2018,

04-09-2018,

05-09-2018,

06-09-2018,

07-09-2018];

F:

load Date, Previous(Date) as New_Date

Resident T

order by Date desc;

krishna20
Specialist II
Specialist II
Author

Hi Shivesh,

Thanks for your inputs, but not getting exact result.

jyothish8807
Master II
Master II

Hi Kalyan,

Try this:

A:

load Date#(Date,'DD-MM-YYYY') as Date ;

load * inline

[Date

01-09-2018,

02-09-2018,

03-09-2018,

04-09-2018,

05-09-2018,

06-09-2018,

07-09-2018];

NoConcatenate

b:

Load

Date,

previous(Date) as NewDate

resident A

order by Date desc;

drop table A;

Br,

KCCapture.PNG

Best Regards,
KC
shiveshsingh
Master
Master

Sorry, i missed drop table part.

Please refer below code.

T:

load Date#(Date,'DD-MM-YYYY') as Date;

load * inline

[Date

01-09-2018,

02-09-2018,

03-09-2018,

04-09-2018,

05-09-2018,

06-09-2018,

07-09-2018];

F:

load Date, Previous(Date) as New_Date

Resident T

order by Date desc;

Capture.PNG