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

get the list of users in a network based on earliest timestamp


hi,

I had some datase like below

load * inline

[networkid, user, timestamp

n1,u1,1

n1,u2,2

n1,u3,3

n2,u1,2

n2,u2,3

n2,u3,1

n3,u1,3

n3,u2,2

n3,u3,1

n2,u1,3

n1,u1,3]
;

now i need to get the list of users who are in a network at highest time

something as below.

networkid               timestamp               users

n1                                   3                         u1,u3

n2                                    3                          u2,u1

please help me how to acheive this

17 Replies
preminqlik
Specialist II
Specialist II

send once sample out put,..i'll try what exactly u want ...artham kale ...:(

Not applicable
Author

I had sent you sample datasets.

Timestamp, networked, user are fields.

Now from the two, I need to get the list of users with earliest timestamps grouped by networkid

preminqlik
Specialist II
Specialist II

hh.png

time stamp edi ,user edi?

Not applicable
Author

In the order I had specified.

Timestamp is in unix format

User is 3rd one.

Networked is 2nd one.

suniljain
Master
Master

Following is the logic.

Users:

load * inline [networkid, user, timestamp

n1,u1,1

n1,u2,2

n1,u3,3

n2,u1,2

n2,u2,3

n2,u3,1

n3,u1,3

n3,u2,2

n3,u3,1

n2,u1,3

n1,u1,3];

Final_Table:

Load

networkid,

user,

Max(timestamp) as timestamp

Resident Users Group by networkid , user;

Drop Table Users;

Not applicable
Author

i dont want to group them by network. i want them to group by user only

i want to get only first record of user

some thing like below

user             timestamp(max)               networkid

u1                         3                              n3

u2                          3                              n2

u3                          3                              n1

suniljain
Master
Master

Following is the logic.

Users:

load * inline [networkid, user, timestamp

n1,u1,1

n1,u2,2

n1,u3,3

n2,u1,2

n2,u2,3

n2,u3,1

n3,u1,3

n3,u2,2

n3,u3,1

n2,u1,3

n1,u1,3];

Final_Table:

Load

user,

Max(timestamp) as timestamp

Resident Users Group by user;

Drop Table Users;

saumyashah90
Specialist
Specialist

check this