Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Where Statement

I am doing analysis on a web log. The fields I have are:

UserName,

TimeStamp,

Action,

SessionID (Identifier that tracks an active session)

Before a user logs in, we track their UserName as 'NA' and when they log in their UserName switches to their actual login name. However, we also run scripts to test are servers that are also stored with the UserName 'NA'. Could you guys help me come up with the Where statement that would include the UserName 'NA' when there is another UserName within that SessionID and eliminate the UserNames 'NA' when it is the only UserName in that SessionID?

Thanks in advance,

Eric

2 Replies
jason_michaelid
Honored Contributor II

Re: Where Statement

Can you provide some sample data and required output?

Re: Where Statement

Best guess without sample data.

QualifiedSessions:

LOAD SessionId

where UseridCount>1

;

LOAD

      SessionId,

     count(UserName) as UseridCount

FROM weblogs

GROUP by SessionId

;

SessionLogs:

LOAD *

FROM weblogs

WHERE exists(SessionId)

;

DROP TABLE QualifiedSessions;

-Rob

http://robwunderlich.com

Community Browser