Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good Day All
I Have a Problem, But when i Join it,
the output is not like what i want
EmpCode | TimeCode | TimeLogs |
---|---|---|
Sample1 | F11 | 8:00 |
Sample2 | F11 | 8:30 |
Sample1 | F12 | 7:00 |
Sample2 | F12 | 7:30 |
The Output must be like
EmpCode | TimeIn | TimeOut |
---|---|---|
Sample1 | 8:00 | 7:00 |
Sample2 | 8:30 | 7:30 |
TimeCode is F11=Timein and the F12=TimeOut
The output of my Application is
EmpCode | TimeIn | TimeOut |
---|---|---|
Sample1 | 8:00 | - |
Sample2 | 8:30 | - |
Sample1 | - | 7:00 |
Sample2 | - | 7:30 |
I tried to use all kind of Joins but no effect
Thank you.
Hi,
Here the data is not proper.. for some of the records Time code=F12 is not there and i could see the time code is F32 for some records..
could you elaborate what you want exactly..
Good day sir,
because the partner of this is F11 and F12 , F21 adn F22 [] F31and F32 but i just to test it on f11 and F12.
Thank you very much for your response.
Good Day Sir,
Kindly see my QVD for reference.
Hi,
User this script
[TimeLog]:
LOAD idcount,
empcode,
timecode,
timelogs,
Time,
Date
FROM [TimeLog.qvd] (qvd);
//********* Use Pivot Table ******************
[Method1]:
LOAD
empcode AS [M1.EMP],
timecode AS [M1.Type],
Date AS [M1.TranDate],
Time AS [M1.Log]
Resident [TimeLog] Where Match(timecode,'F11','F12');
//********* Use ApplyMap **********************
[TimeIn]:
MAPPING LOAD
empcode &'-'& Date,
Time
Resident [TimeLog] Where timecode='F11';
[TimeOut]:
MAPPING LOAD
empcode &'-'& Date,
Time
Resident [TimeLog] Where timecode='F12';
[Method2]:
LOAD Distinct
empcode AS [M2.EMP],
Date AS [M2.TranDate],
ApplyMap('TimeIn',empcode &'-'& Date,NULL()) AS [M2.TimeIn],
ApplyMap('TimeOut',empcode &'-'& Date,NULL()) AS [M2.TimeOut]
Resident [TimeLog] Where Match(timecode,'F11','F12');
See sample attached file.
Regards,
Sokkorn
I guess you are only intresed in for a given employeecode Time in and Time out...
See attached...
Phani
Hi ,
check out this
step 1:
Directory;
LOAD empcode,
timecode,
IF(timecode='F11','ti','to') as flag,
timelogs
FROM
test123.xlsx
(ooxml, embedded labels, table is Sheet2);
step 2 :
create a chart staright table
add empcode as dimension
write two set analysis
=sum({<flag={'to'}>}timelogs) for time out
sum({<flag={'ti'}>}timelogs) for time in
you will get what you want
Yup but a Date too.
Perhaps I misunderstand, but how do you associate a particular time-OUT with another time-IN for any given employee? In your data, sometimes you have time-OUT's with no apparent associated time-IN, and vice-versa. Maybe I am missing something, but is there some way you tie the time-OUT records to a specific time-IN record?
I put together an example where the date of the time-IN is used to associate with a time-OUT. I've attached QVW, and code is below.
TimeLog:
Load
*,
empcode & Date(Date,'YYYYMMDD') As empkey;
LOAD
idcount,
empcode,
timecode,
timelogs,
Time,
Date
FROM
TimeLog.qvd (qvd);
LogData:
LOAD
empcode,
empcode & Date(Date,'YYYYMMDD') As empkey,
timelogs As TimeIn
Resident TimeLog WHERE timecode='F11';
Left Join Load
empcode & Date(Date,'YYYYMMDD') As empkey,
timelogs As TimeOut
Resident TimeLog WHERE timecode='F12';
Drop Table TimeLog;
This assumes the time-OUT will always occur on the same day as the time-IN. If that is not so, then you'll either need another field to help associate the two events, or you could construct a model that assumes the time-IN's and time-OUT's are sequential (i.e., OUT always follows IN). But again, I see problems in the data with this. You sometimes have multiple OUT's with no apparent corresponding IN record, etc.
Hi,
Source :
EmpCode | TimeCode | TimeLogs |
Sample1 | F11 | 8:00 |
Sample2 | F11 | 8:30 |
Sample1 | F12 | 7:00 |
Sample2 | F12 | 7:30 |
Script
Table:
LOAD EmpCode,
//TimeCode,
TimeLogs as Timein
FROM
(ooxml, embedded labels, table is Tab3)
Where TimeCode='F11';
inner join
LOAD EmpCode,
//TimeCode,
TimeLogs as Timeout
FROM
(ooxml, embedded labels, table is Tab3)
Where TimeCode='F12';
Result :
EmpCode | Timein | Timeout |
Sample1 | 8:00 | 7:00 |
Sample2 | 8:30 | 7:30 |