<?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 Problem using firstvalue() or minsting() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-using-firstvalue-or-minsting/m-p/300076#M111142</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to create an application that analyzes the log files you can get QV to generate.&lt;/P&gt;&lt;P&gt;I'm extracting startdate and time and enddate and time along with any errors that occured while loading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem in the script below occurs in the table Post_Dynamic:&lt;/P&gt;&lt;P&gt;I need the firstvalue in Unique_Id to be duplicated for all rows.&lt;/P&gt;&lt;P&gt;Otherwise I do not know from what date the errors occur since this is only a part of the script.&lt;/P&gt;&lt;P&gt;I have tried using both firstvalue() and minstring() but the result is the same, i.e. both values in this field are still remaining.&lt;/P&gt;&lt;P&gt;Anyone that can tell me what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Pre_Dynamic:&lt;BR /&gt;LOAD &lt;BR /&gt;&amp;nbsp; If(left(@27:n, 11) = 'Execution s',&amp;nbsp; @1:10)&amp;nbsp;&amp;nbsp; as Date_Start, &lt;BR /&gt;&amp;nbsp; If(left(@27:n, 11) = 'Execution f',&amp;nbsp; @1:10)&amp;nbsp;&amp;nbsp; as Date_End, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(left(@27:n, 11) = 'Execution s',&amp;nbsp; @12:19)&amp;nbsp; as Time_Start, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(left(@27:n, 11) = 'Execution f',&amp;nbsp; @12:19)&amp;nbsp; as Time_End,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(trim(left(@27:n, 7))&amp;nbsp; = 'Error:', @27:n)&amp;nbsp;&amp;nbsp; as Error,&lt;BR /&gt;&amp;nbsp; if(trim(left(@27:n, 7))&amp;nbsp; = 'Error:', rowno()-1) as Error_number,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filebasename() as Application,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right(filedir(),3) as Company&lt;BR /&gt;//FROM U:\PCD\*.log&lt;BR /&gt;FROM D:\QlikViewDocuments\PCD\Marknad.qvw.log&lt;BR /&gt;(fix, codepage is 1252)&lt;BR /&gt;WHERE trim(left(@27:n, 7))= 'Error:'&lt;BR /&gt;or left(@27:n, 9) = 'Execution';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dynamic: &lt;BR /&gt;NoConcatenate Load&lt;BR /&gt;max(Date_Start) as Date_Start,&lt;BR /&gt;max(Date_End) as Date_End,&lt;BR /&gt;max(Time_Start) as Time_Start,&lt;BR /&gt;max(Time_End) as Time_End,&lt;BR /&gt;max(Date_Start)&amp;amp;'-'&amp;amp; max(Time_Start) &amp;amp;'-'&amp;amp; Application &amp;amp;'-'&amp;amp; Company as Unique_Id,&lt;BR /&gt;Error,&lt;BR /&gt;Error_number,&lt;BR /&gt;Application,&lt;BR /&gt;Company&lt;BR /&gt;Resident Pre_Dynamic&lt;BR /&gt;group by Application, Company, Error, Error_number;&lt;/P&gt;&lt;P&gt;drop table Pre_Dynamic;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Post_Dynamic:&lt;BR /&gt;NoConcatenate Load&lt;BR /&gt;Date_Start,&lt;BR /&gt;Date_End,&lt;BR /&gt;Time_Start,&lt;BR /&gt;Time_End,&lt;BR /&gt;FirstValue(Unique_Id) as Unique_Id,&lt;BR /&gt;Error,&lt;BR /&gt;Error_number,&lt;BR /&gt;Application,&lt;BR /&gt;Company&lt;BR /&gt;Resident Dynamic&lt;BR /&gt;group by Date_Start, Date_End, Time_Start, Time_End, Error, Error_number, Application, Company;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;drop table Dynamic;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;P&gt;Martin &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 May 2011 21:36:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-05-14T21:36:02Z</dc:date>
    <item>
      <title>Problem using firstvalue() or minsting()</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-using-firstvalue-or-minsting/m-p/300076#M111142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to create an application that analyzes the log files you can get QV to generate.&lt;/P&gt;&lt;P&gt;I'm extracting startdate and time and enddate and time along with any errors that occured while loading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem in the script below occurs in the table Post_Dynamic:&lt;/P&gt;&lt;P&gt;I need the firstvalue in Unique_Id to be duplicated for all rows.&lt;/P&gt;&lt;P&gt;Otherwise I do not know from what date the errors occur since this is only a part of the script.&lt;/P&gt;&lt;P&gt;I have tried using both firstvalue() and minstring() but the result is the same, i.e. both values in this field are still remaining.&lt;/P&gt;&lt;P&gt;Anyone that can tell me what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Pre_Dynamic:&lt;BR /&gt;LOAD &lt;BR /&gt;&amp;nbsp; If(left(@27:n, 11) = 'Execution s',&amp;nbsp; @1:10)&amp;nbsp;&amp;nbsp; as Date_Start, &lt;BR /&gt;&amp;nbsp; If(left(@27:n, 11) = 'Execution f',&amp;nbsp; @1:10)&amp;nbsp;&amp;nbsp; as Date_End, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(left(@27:n, 11) = 'Execution s',&amp;nbsp; @12:19)&amp;nbsp; as Time_Start, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(left(@27:n, 11) = 'Execution f',&amp;nbsp; @12:19)&amp;nbsp; as Time_End,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(trim(left(@27:n, 7))&amp;nbsp; = 'Error:', @27:n)&amp;nbsp;&amp;nbsp; as Error,&lt;BR /&gt;&amp;nbsp; if(trim(left(@27:n, 7))&amp;nbsp; = 'Error:', rowno()-1) as Error_number,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filebasename() as Application,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right(filedir(),3) as Company&lt;BR /&gt;//FROM U:\PCD\*.log&lt;BR /&gt;FROM D:\QlikViewDocuments\PCD\Marknad.qvw.log&lt;BR /&gt;(fix, codepage is 1252)&lt;BR /&gt;WHERE trim(left(@27:n, 7))= 'Error:'&lt;BR /&gt;or left(@27:n, 9) = 'Execution';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dynamic: &lt;BR /&gt;NoConcatenate Load&lt;BR /&gt;max(Date_Start) as Date_Start,&lt;BR /&gt;max(Date_End) as Date_End,&lt;BR /&gt;max(Time_Start) as Time_Start,&lt;BR /&gt;max(Time_End) as Time_End,&lt;BR /&gt;max(Date_Start)&amp;amp;'-'&amp;amp; max(Time_Start) &amp;amp;'-'&amp;amp; Application &amp;amp;'-'&amp;amp; Company as Unique_Id,&lt;BR /&gt;Error,&lt;BR /&gt;Error_number,&lt;BR /&gt;Application,&lt;BR /&gt;Company&lt;BR /&gt;Resident Pre_Dynamic&lt;BR /&gt;group by Application, Company, Error, Error_number;&lt;/P&gt;&lt;P&gt;drop table Pre_Dynamic;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Post_Dynamic:&lt;BR /&gt;NoConcatenate Load&lt;BR /&gt;Date_Start,&lt;BR /&gt;Date_End,&lt;BR /&gt;Time_Start,&lt;BR /&gt;Time_End,&lt;BR /&gt;FirstValue(Unique_Id) as Unique_Id,&lt;BR /&gt;Error,&lt;BR /&gt;Error_number,&lt;BR /&gt;Application,&lt;BR /&gt;Company&lt;BR /&gt;Resident Dynamic&lt;BR /&gt;group by Date_Start, Date_End, Time_Start, Time_End, Error, Error_number, Application, Company;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;drop table Dynamic;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;P&gt;Martin &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 May 2011 21:36:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-using-firstvalue-or-minsting/m-p/300076#M111142</guid>
      <dc:creator />
      <dc:date>2011-05-14T21:36:02Z</dc:date>
    </item>
  </channel>
</rss>

