Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need expression to get the Previous/Next values for a given record

Below is a sample of my source data-

Member Member

Name   Level    From       To

------ -------- ---------- ----------

A      Basic    01/01/2011 12/31/2011

A      Enhanced 01/01/2012 09/30/2012

A      Elite    10/01/2012 06/30/2013

B      Enhanced 01/01/2011 06/30/2012

B      Basic    07/01/2012 12/31/2013

C      Elite    01/01/2012 12/31/2013

I would like to display the above data in a table with 2 additional columns showing the previous and next Member Level as follows-

Member Member                         Previous Next

Name   Level    From       To         Level    Level

------ -------- ---------- ---------- -------- --------

A      Basic    01/01/2011 12/31/2011          Enhanced

A      Enhanced 01/01/2012 09/30/2012 Basic    Elite

A      Elite    10/01/2012 06/30/2013 Enhanced

B      Enhanced 01/01/2011 06/30/2012          Basic

B      Basic    07/01/2012 12/31/2013 Enhanced

C      Elite    01/01/2012 12/31/2013

Based on selections not all the records may be displayed. However the values for Next and Previous are based on the entire data set and

are independent of the selections.

Can someone tell me the best way to derive the 2 additional columns.

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

In the script with the previous() function. See attached example


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

In the script with the previous() function. See attached example


talk is cheap, supply exceeds demand