Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I do this type for Previous () ( it returns the values of expression using data from the previous input record
Data:
LOAD * INLINE [
Emp_No, Emp_Name, Join_Date
1, Mani, 15-01-2013
2, deep, 16-02-2013
3, Sudeep, 17-08-2012
4, mani, 19-06-2011
5, Jaya, 16-12-2010
] ;
Previous:
LOAD Previous(Previous(Emp_Name) )as Name Resident Data ;
but my data is come this type
Emp_No | Emp_Name | Join_Date | Name |
2 | deep | 16-02-2013 | Mani |
2 | deep | 16-02-2013 | deep |
2 | deep | 16-02-2013 | Sudeep |
5 | Jaya | 16-12-2010 | Mani |
5 | Jaya | 16-12-2010 | deep |
5 | Jaya | 16-12-2010 | Sudeep |
1 | Mani | 15-01-2013 | Mani |
1 | Mani | 15-01-2013 | deep |
1 | Mani | 15-01-2013 | Sudeep |
4 | mani | 19-06-2011 | Mani |
4 | mani | 19-06-2011 | deep |
4 | mani | 19-06-2011 | Sudeep |
3 | Sudeep | 17-08-2012 | Mani |
3 | Sudeep | 17-08-2012 | deep |
3 | Sudeep | 17-08-2012 | Sudeep |
my doubt is why the data is coming more times how it is evaluated?
Data:
LOAD * INLINE
[
Emp_No, Emp_Name, Join_Date
1, Mani, 15-01-2013
2, deep, 16-02-2013
3, Sudeep, 17-08-2012
4, mani, 19-06-2011
5, Jaya, 16-12-2010
];
Left Join (Data)
Load Emp_No, Previous(Emp_Name) as Name Resident Data
Order By Join_Date;
Is this your actual script? There is extra paranthesis in the previous table.. not a problem.
But , I think your script will act as a full outer join.
How do you want the result?
Data:
LOAD * INLINE
[
Emp_No, Emp_Name, Join_Date
1, Mani, 15-01-2013
2, deep, 16-02-2013
3, Sudeep, 17-08-2012
4, mani, 19-06-2011
5, Jaya, 16-12-2010
];
Left Join (Data)
Load Emp_No, Previous(Emp_Name) as Name Resident Data
Order By Join_Date;
Not the script but the sheet object you create from two tables without any association will create an outer join (aka Cartesian Product). See Manish's example to correct this situation.