I'm generating a table below by doing some calculations in QlikView:
Key
As of term
Term
Type
101
2009 1st term
2009 1st term
Current
102
2009 2nd term
2009 2nd term
Current
103
2010 1st term
2010 1st term
Current
104
2010 2nd term
2010 2nd term
Current
2009 1st term
2008 2nd term
Previous
2009 2nd term
2009 1st term
Previous
2010 1st term
2009 2nd term
Previous
2010 2nd term
2010 1st term
Previous
Now my requirement is to update keys of this table when Type=Previous, depending upon the values of other column.
e.g.
1]When type=Previous, AsOfterm=2009 1st Term, Term=2008 2nd term
on this row, QlikView Query executer should serach for the values of Term (here 2008 2nd term), find the matching value in the AsOfTerm column and when the mathch is found , that record's key value should be copied to the current row. here key is updated as -, because 2008 2nd term value is not present in AsOfTerm column.
2] When type=Previous, AsOfterm=2009 2nd Term, Term=2009 1st term
here key is updated as 101
Below is ths expected O/P table:
Key
As of term
Term
Type
101
2009 1st term
2009 1st term
Current
102
2009 2nd term
2009 2nd term
Current
103
2010 1st term
2010 1st term
Current
104
2010 2nd term
2010 2nd term
Current
-
2009 1st term
2008 2nd term
Previous
101
2009 2nd term
2009 1st term
Previous
102
2010 1st term
2009 2nd term
Previous
103
2010 2nd term
2010 1st term
Previous
can anybody guide me, how to achive above requirement?