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: 
Anonymous
Not applicable

Time Extraction

Dear all,

I am having a field say TimeStamp which stores intime(AM) and outime(PM) of a person.

Sample:   PersonName  TimeStamp

                  ABC             8:35:02 AM

                  ABC             5:32:04 PM

I want to represent TimeStamp filed into two fields say InTime and OutTime w.r.t person.

Format:          PersonName        InTime            OutTime

                       ABC              8:35:02 AM          5:32:04 PM

Reply me ASAP.

Regards,

Balraj Ahlawat

20 Replies
Anonymous
Not applicable
Author

Sunil,

Both the fields are into 2 different tables.

Can we resident two tables at one time?

Regards,

Balraj

SunilChauhan
Champion II
Champion II

you should  clarify the situation @ start

no we cant take resident from two tables

we can take two seperate resident for that

and combine them into one based on some key field


Sunil Chauhan
Anonymous
Not applicable
Author

Kaushik,

I have seen in the data, people are there who logged in at 12.30 PM and logged out at 8.30 PM.

It is in the data only.

Regards,

Balraj

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Dear Balraj,

     I understand that you can look at the data and make out that this is an evening shift, but there has to be some way for QlikView to understand same.

     Meaning there should be some flag which specifies that this is an evening shift where PM is the start entry and AM is out entry.

Regards,.

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

Sure Sunil,

It was my mistake, I didn't share at the start.

But this is the scenario I am having,  see if can suggest any solution.

Regards,

Balraj

SunilChauhan
Champion II
Champion II

better if you can describe what are the field available in two tables

that makes easy to helps for every one

Sunil Chauhan
Anonymous
Not applicable
Author

Dear Kaushik,

There is no evening shift...Let me tell you complete scenario from start.

I am having two table say X1 & X2 with multiple fields. In X1 table I am having one field PersonName and in X2 table one field is PunchTime and they are connected through a field say PersonID.


Now data is stored like this in X2:


PersonID         PunchTime

100001        5/6/2014  8.48 AM

100001        5/6/2014  5.49 PM

100001        5/5/2014  12.20 PM

100001        5/5/2014   7.30 PM 


There is no rotational shift, its a general shift. Some of the person have punched in 2nd half as well. Same thing is repeated whole month/year etc.


Now I want to display like this:


PersonName     PersonID          InTime                           OutTime

ABC                  100001          5/6/2014 8.48 AM         5/6/2014    5.49 PM

ABC                   100001         5/5/2014 12.20 PM       5/5/2014    7.30 PM


I hope, it will help you to understand completely.


Regards,

Balraj

Anonymous
Not applicable
Author

Kaushik,

Flag is here but it's not properly maintained and its not working with this problem.

See, if any alternate possible?

Regards,

Balraj

SunilChauhan
Champion II
Champion II

use intervalmatch function

load *

from X1;

load * from X2;

intervalmatch(PunchTime)

load inTime,Outtime from X2;

hope this helps


Sunil Chauhan
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Then you will have to find the minimum time for a day and maximum time for a day.

Try this.

Load Person_ID,Min(Timestamp) as InTime, Max(Timestamp) as outtime resident xyz

group by Person_ID,date(floor(Timestamp));

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!