Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Server log files [Cal Type] dimension

Hi all,

I need to extract the current CAL type for each user from the Sessions_servername log file generated by the server. As users may have had more than one type of licence, I want to base it on the max of SessionsTimestamp.

I have the following:

only({1<SessionsTimestamp={$(=max(SessionsTimestamp))}>} [Cal Type])

but it doesn't work.

Can someone familiar with the log files advise?

Many thanks.

1 Reply
matt_crowther
Specialist
Specialist

This isn't a Log File related solution but you may well find the solution by looking at the firstsortedvalue() function; sort by SessionTime (Descending) then the first value per user will be the current (or latest) CAL Type.

Alternatively; in the load script sort the table containing the SessionTime, UserID, CALType first by UserID then SessionTime (Descending), then in a preceeding load use the previous() function to compare UserID's - if they're different then you must be looking at the most recent Session for that UserID - if not there must be an earlier one.

Eg::

Policy:

Load *,

if(previous(QuoteNumber)=QuoteNumber,0,1) as CurrentRecordFlag,

if(previous(QuoteNumber)=QuoteNumber,null(),Status) as FullStatus,

month(CreatedDate) as CreatedMonth,

year(CreatedDate) as YearCreated,

week(CreatedDate) as WeekCreated,

ceil(month(CreatedDate)/3,1) as QuarterCreated,

if(Status='Quote' and (today()-CreatedDate)>30,'NTU',if(Status='Quote' and (today()-CreatedDate)<=30,'Pending',Status)) as TrueStatus

//if(FullStatus='Quote' and (today()-CreatedDate)>30,'NTU',if(FullStatus='Quote' and (today()-CreatedDate)<=30,'Pending',FullStatus)) as TrueFullStatus

Resident Policy_TMP2 Order By QuoteNumber Asc, DateTime Desc, PolKey Desc;

Hope that helps,

Matt - Visual Analytics Ltd