Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filtering Records from QVD Load

Hi, I am new to Qlikview and do not have much coding background. I have a master qvd file that contains data similar to table below :

   

Table : Emp_Sign_Record
IdStaff NoSign Off DateTask ID
3A6-May-16FS -00556
4A7-May-16FS -00259
5C10-May-16FS -00637
6B11-May-16MZ -00772
7B11-May-16GT -00234
8A11-May-16FS -00201
9C12-May-16GT -00548
10A12-May-16FS -00869

I am trying to load only details for the last record for each staff so that only the following is loaded but is having all kinds of issues. Would it better to load Table 1 and create table 2 as a resident table?

   

Load Results : Emp_Last_Sign
IdStaff NoSign Off DateTask ID
10A12-May-16FS -00869
7B11-May-16GT -00234
9C12-May-16GT -00548

Appreciate some help from anyone here. Thanks.

2 Replies
sunny_talwar

May be try like this:

TableName:

LOAD FirstSortedValue(Id, [Sign Off Date]) as Id,

          [Staff No],

          Date(Max([Sign Off Date])) as [Sign Off Date],

          FirstSortedValue([Task ID], [Sign Off Date]) as [Task ID]

FROM YourQvdFile.qvd (qvd)

Group By [Staff No];

Alternatively, you can also do this:

TableName:

LOAD Id,

          [Staff No],

          [Sign Off Date],

          [Task ID]

FROM YourQvdFile.qvd (qvd);


Right Join(TableName)

LOAD [Staff No],

          Date(Max([Sign Off Date])) as [Sign Off Date]

Resident TableName

Group By [Staff No];

MarcoWedel

Hi,

one solution could be also:

QlikCommunity_Thread_215181_Pic1.JPG

table1:

LOAD * FROM [https://community.qlik.com/thread/215181] (html, codepage is 1252, embedded labels, table is @1, filters(Remove(Row, Pos(Top, 1))));

table2:

LOAD *, [Staff No] as TempFld

Resident table1

Where not Exists (TempFld,[Staff No])

Order By [Sign Off Date] desc;

DROP Table table1;

DROP Field TempFld;

hope this helps

regards

Marco