<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Server log files [Cal Type] dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Server-log-files-Cal-Type-dimension/m-p/279571#M104041</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Policy:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt; if(previous(QuoteNumber)=QuoteNumber,0,1) as CurrentRecordFlag,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; if(previous(QuoteNumber)=QuoteNumber,null(),Status) as FullStatus,&lt;/P&gt;&lt;P&gt; month(CreatedDate) as CreatedMonth,&lt;/P&gt;&lt;P&gt; year(CreatedDate) as YearCreated,&lt;/P&gt;&lt;P&gt; week(CreatedDate) as WeekCreated,&lt;/P&gt;&lt;P&gt; ceil(month(CreatedDate)/3,1) as QuarterCreated,&lt;/P&gt;&lt;P&gt; if(Status='Quote' and (today()-CreatedDate)&amp;gt;30,'NTU',if(Status='Quote' and (today()-CreatedDate)&amp;lt;=30,'Pending',Status)) as TrueStatus&lt;/P&gt;&lt;P&gt; //if(FullStatus='Quote' and (today()-CreatedDate)&amp;gt;30,'NTU',if(FullStatus='Quote' and (today()-CreatedDate)&amp;lt;=30,'Pending',FullStatus)) as TrueFullStatus&lt;/P&gt;&lt;P&gt;Resident Policy_TMP2 &lt;STRONG&gt;&lt;EM&gt;Order By QuoteNumber Asc, DateTime Desc&lt;/EM&gt;&lt;/STRONG&gt;, PolKey Desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2011 14:56:23 GMT</pubDate>
    <dc:creator>matt_crowther</dc:creator>
    <dc:date>2011-08-17T14:56:23Z</dc:date>
    <item>
      <title>Server log files [Cal Type] dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Server-log-files-Cal-Type-dimension/m-p/279570#M104040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to extract the current CAL type for each user from the Sessions_&lt;EM&gt;servername &lt;/EM&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following:&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;only&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: arial,helvetica,sans-serif;"&gt;({1&amp;lt;&lt;SPAN style="color: #800000;"&gt;SessionsTimestamp&lt;/SPAN&gt;={&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(=max(SessionsTimestamp))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: arial,helvetica,sans-serif;"&gt;}&amp;gt;} [Cal Type])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;but it doesn't work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Can someone familiar with the log files advise?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Many thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;EM style="color: #808080; font-size: 10pt;"&gt;&lt;EM style="color: #808080; font-size: 10pt;"&gt; &lt;/EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 14:08:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Server-log-files-Cal-Type-dimension/m-p/279570#M104040</guid>
      <dc:creator />
      <dc:date>2011-08-17T14:08:27Z</dc:date>
    </item>
    <item>
      <title>Server log files [Cal Type] dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Server-log-files-Cal-Type-dimension/m-p/279571#M104041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Policy:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt; if(previous(QuoteNumber)=QuoteNumber,0,1) as CurrentRecordFlag,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; if(previous(QuoteNumber)=QuoteNumber,null(),Status) as FullStatus,&lt;/P&gt;&lt;P&gt; month(CreatedDate) as CreatedMonth,&lt;/P&gt;&lt;P&gt; year(CreatedDate) as YearCreated,&lt;/P&gt;&lt;P&gt; week(CreatedDate) as WeekCreated,&lt;/P&gt;&lt;P&gt; ceil(month(CreatedDate)/3,1) as QuarterCreated,&lt;/P&gt;&lt;P&gt; if(Status='Quote' and (today()-CreatedDate)&amp;gt;30,'NTU',if(Status='Quote' and (today()-CreatedDate)&amp;lt;=30,'Pending',Status)) as TrueStatus&lt;/P&gt;&lt;P&gt; //if(FullStatus='Quote' and (today()-CreatedDate)&amp;gt;30,'NTU',if(FullStatus='Quote' and (today()-CreatedDate)&amp;lt;=30,'Pending',FullStatus)) as TrueFullStatus&lt;/P&gt;&lt;P&gt;Resident Policy_TMP2 &lt;STRONG&gt;&lt;EM&gt;Order By QuoteNumber Asc, DateTime Desc&lt;/EM&gt;&lt;/STRONG&gt;, PolKey Desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 14:56:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Server-log-files-Cal-Type-dimension/m-p/279571#M104041</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2011-08-17T14:56:23Z</dc:date>
    </item>
  </channel>
</rss>

