04-11-2016 01:51 PM
I have a data set like this:
What I want is like this:
The years of 2004 and 2008 are benchmarks I identified. I want to use these two benchmarks as initial years to calculate ages for relative years.
The data set I am working with is very large, what I showed in the figure is just one group identified by several other attributes.
Is there any way that can accomplish this?
04-11-2016 01:59 PM
Is there a rule involved? It looks like if EFF_Year is 2004 to 2007 then assign 2004 and possibly a range but not specified if EFF_Year is 2008 to some value then assign 2008. Is this the case? If so, what is the largest value of EFF_Year that should receive an assignment to flag of 2008?
These could look like:
If 2004 le EFF_Year le 2007 then flag=2004;
else if 2008 le Eff_year le 2009 then flag = 2008; /*<= replace 2009 if you have a different upper bound*/
/* add similar statements if you have other groups*/
If you have a large number of groups there may be other approaches but the Rule needs to be provided. Example results do not always provide sufficient details of rules.
Need further help from the community? Please ask a new question.