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: 
rahulhv1
Creator II
Creator II

Issue may be in sql query or may be data table structure : Suggest me the solution

Pls. suggest me the solution, i think its not possible in QlikView.

1. Employee Master Table (Number of employees more than 2000)

(Sample size of data is as under ).

Employee Master Table

empcodename
1rahul
2abhijeet
3ranjeet
4sachin
5anil
6vinod
7manish
8abcd

2. Attendance record file:  Pls. note tha more than 2000 records available and entiries are for only those employees who are present on the date are available. Employees which are not present is not available in this table,

(Sample size of data is as under )

Daily Attendence Table

empcodenamedate
1rahul02-Aug-14
2abhijeet02-Aug-14
3ranjeet02-Aug-14
4sachin02-Aug-14
5anil02-Aug-14

3. Result i want :  Result i want is that, whenever user selects  date from list box (in this example 02 Aug 2014) , result should be like as under

empcodenamedatestatus
1rahul02-Aug-14Present
2abhijeet02-Aug-14Present
3ranjeet02-Aug-14Present
4sachin02-Aug-14Present
5anil02-Aug-14Present
6vinod02-Aug-14Absent
7manish02-Aug-14Absent
8abcd02-Aug-14Absent
18 Replies
rahulhv1
Creator II
Creator II
Author

sorry prem, its not working


VishalWaghole
Specialist II
Specialist II

Hi Rahul,

Please upload some sample Qvw with dummy data.

i will try and let you know.

-- Regards,

Vishal Waghole

rahulhv1
Creator II
Creator II
Author

How to send attachment? *.XLS & QVW


preminqlik
Specialist II
Specialist II

go to "Use advance editor" in right top side in comment section after pressing reply button

rahulhv1
Creator II
Creator II
Author

Thanks for your help prem, I tried it and i solved the issue. Below is the code that executed and it worked as per my requirment.

 

table1:

LOAD empcode,
name,dept
FROM

(
ooxml, embedded labels, table is Sheet1);
join
LOAD DISTINCT date
FROM

(
ooxml, embedded labels, table is Sheet1);

left join
load empcode,name, date as realdate from

(
ooxml, embedded labels, table is Sheet1);

table2:
load empcode ,name,date,dept,realdate, if(date=realdate ,'Present','Absent') as status Resident table1;

load MaxString(status) as stauts, empcode ,name,date,dept resident table2 group by empcode, name,date,dept;
drop table table1;
tab3:
load status,date,realdate, empcode ,name,dept resident table2;
drop table table2;

rahulhv1
Creator II
Creator II
Author

Hi Vishal, Thanks for your help, i have done it with below code

 

table1:

LOAD empcode,
name,dept
FROM

(
ooxml, embedded labels, table is Sheet1);
join
LOAD DISTINCT date
FROM

(
ooxml, embedded labels, table is Sheet1);

left join
load empcode,name, date as realdate from

(
ooxml, embedded labels, table is Sheet1);

table2:
load empcode ,name,date,dept,realdate, if(date=realdate ,'Present','Absent') as status Resident table1;

load MaxString(status) as stauts, empcode ,name,date,dept resident table2 group by empcode, name,date,dept;
drop table table1;
tab3:
load status,date,realdate, empcode ,name,dept resident table2;
drop table table2;

preminqlik
Specialist II
Specialist II

HI,

ok .for your crystal clear understanding ..in the first step left joined with distinct date is known as Cartesian Product.

rahulhv1
Creator II
Creator II
Author

Thanks a lot for the same

VishalWaghole
Specialist II
Specialist II

Thats gr8 job Rahul.... keep it up..!!!