Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Getting Next Occurrence Date

Hi All,

I am quite new with qlikview, and I am currently struggling to find the solution for my case.

I have only this table.

TestTable.png

And I would like to have extra column in the table like below. Basically that column is looking for the next occurrence DATE for particular NAME, otherwise keep it with today's date

ExpectedTableResult.png

Any suggestion on how to make it happen on script load level?

Your ideas are much appreciated

1 Solution

Accepted Solutions
sunny_talwar

Try this

Table:

LOAD * INLINE [

    DATE, NAME, LOCATION

    01/05/2017, BD1, A

    01/09/2017, BD2, M

    02/10/2017, BD1, G

    03/15/2017, BD1, X

    04/01/2017, BD1, TRASH

    04/10/2017, BD2, TRASH

];


FinatTable:

LOAD *,

Date(If(NAME = Previous(NAME), Previous(DATE), Today())) as [Next Date]

Resident Table

Order By NAME, DATE desc;


DROP Table Table;

Capture.PNG

View solution in original post

3 Replies
sunny_talwar

Try this

Table:

LOAD * INLINE [

    DATE, NAME, LOCATION

    01/05/2017, BD1, A

    01/09/2017, BD2, M

    02/10/2017, BD1, G

    03/15/2017, BD1, X

    04/01/2017, BD1, TRASH

    04/10/2017, BD2, TRASH

];


FinatTable:

LOAD *,

Date(If(NAME = Previous(NAME), Previous(DATE), Today())) as [Next Date]

Resident Table

Order By NAME, DATE desc;


DROP Table Table;

Capture.PNG

Anonymous
Not applicable
Author

Spot on!..

Thanks a bunch

Brownie
Contributor III
Contributor III

Screenshot_13.png

I cant get my this desired result using your method.  I need this particular arrangement.