Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Doubt in Previous ()

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_NoEmp_NameJoin_DateName
2deep16-02-2013Mani
2deep16-02-2013deep
2deep16-02-2013Sudeep
5Jaya16-12-2010Mani
5Jaya16-12-2010deep
5Jaya16-12-2010Sudeep
1Mani15-01-2013Mani
1Mani15-01-2013deep
1Mani15-01-2013Sudeep
4mani19-06-2011Mani
4mani19-06-2011deep
4mani19-06-2011Sudeep
3Sudeep17-08-2012Mani
3Sudeep17-08-2012deep
3Sudeep17-08-2012

Sudeep

my doubt is why  the data is coming more times how it is evaluated?

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

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;

View solution in original post

3 Replies
settu_periasamy
Master III
Master III

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?

MK_QSL
MVP
MVP

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;

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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.