<?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 Re: Peek is slow. Any workaround? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772242#M59778</link>
    <description>&lt;P&gt;Hi! A way to reduce many loops is to replace entire Do While..Loop section with something like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Concatenate [Employee Attendance Hour Track]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load '$(vAttendanceDate)' as [Date1], '$(vEmployeeId)' as [EmpId], &lt;STRONG&gt;Hour&lt;/STRONG&gt; as [Hour1], $(i) as i, $(vMyRecordNo) as MyRecordNo &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RESIDENT Hours&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;WHERE Hour &amp;gt;= $(vStart) AND Hour&amp;lt;=$(vEnd);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You must create a table &lt;STRONG&gt;Hours&lt;/STRONG&gt; with a field &lt;STRONG&gt;Hour&lt;/STRONG&gt; from 0 to 23. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note that only works fine if end hour is within the same day (&amp;lt;24).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think, in 8 hours working days, you can reduce loops up to 88%...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards, Fernando&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jan 2021 13:10:53 GMT</pubDate>
    <dc:creator>Fernando_Fabregas</dc:creator>
    <dc:date>2021-01-06T13:10:53Z</dc:date>
    <item>
      <title>Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772217#M59773</link>
      <description>&lt;P&gt;I am working on Employee Attendance data.&amp;nbsp; The attendance data has Employee Id, Attendance date, Date &amp;amp; Time In and Date &amp;amp; Time Out.&lt;/P&gt;&lt;P&gt;My requirement is to make a table where I list all the hours when an Employee is present. That means if an employee punches in at 8Am and Punches out at 5PM; I need the below hours in my employee attendance hours table:&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;11&lt;/P&gt;&lt;P&gt;12&lt;/P&gt;&lt;P&gt;13&lt;/P&gt;&lt;P&gt;14&lt;/P&gt;&lt;P&gt;15&lt;/P&gt;&lt;P&gt;16&lt;/P&gt;&lt;P&gt;17&lt;/P&gt;&lt;P&gt;When I write the code; I use the Peek function in a do while loop at it takes more than an hour to parse 100 thousand records. Is there any workaround to speed up the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:38:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772217#M59773</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2024-11-16T17:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772218#M59774</link>
      <description>&lt;P&gt;The below is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LET vNumRows = NoOfRows('Attendance');rdNo=1;&lt;/P&gt;&lt;P&gt;[Employee Attendance Hour Track]:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Load 0 as [Date1], 0 as [EmpId], 0 as [Hour1], 0 as i, 0 as MyRecordNo AutoGenerate 0;&lt;/P&gt;&lt;P&gt;FOR i=0 to $(vNumRows)-1&lt;BR /&gt;&lt;BR /&gt;LET vAttendanceDate=Date(Peek('Attendance Date',$(i), 'Attendance'),'D/M/YYYY');&lt;BR /&gt;LET vEmployeeId=Peek('Employee Id',$(i), 'Attendance');&lt;BR /&gt;&lt;BR /&gt;LET vStart=Peek('Period Start',$(i), 'Attendance');&lt;BR /&gt;LET vEnd=Peek('Period End',$(i), 'Attendance');&lt;BR /&gt;//do some stuff....&lt;/P&gt;&lt;P&gt;Do while vStart &amp;lt;= vEnd&lt;BR /&gt;Let vHour=hour(vStart);&lt;/P&gt;&lt;P&gt;Concatenate [Employee Attendance Hour Track]:&lt;BR /&gt;Load '$(vAttendanceDate)' as [Date1], '$(vEmployeeId)' as [EmpId], $(vHour) as [Hour1], $(i) as i, $(vMyRecordNo) as MyRecordNo AutoGenerate (1);&lt;BR /&gt;&lt;BR /&gt;Let vStart = Timestamp(vStart + 1/24) ;&lt;BR /&gt;Let vMyRecordNo = vMyRecordNo + 1;&lt;BR /&gt;&lt;BR /&gt;Loop&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LET vAttendanceDate=Null();&lt;BR /&gt;LET vEmployeeId=Null();&lt;BR /&gt;&lt;BR /&gt;LET vStart=Null();&lt;BR /&gt;LET vEnd=Null();&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 11:26:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772218#M59774</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2021-01-06T11:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772220#M59775</link>
      <description>&lt;P&gt;We may help to optimize your script if you can help us your script?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 11:26:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772220#M59775</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2021-01-06T11:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772224#M59776</link>
      <description>&lt;P&gt;For me script is good as per flow and process after my debug. Can we know where you feel the performance is bad? Is that loading long time (If so, confirm how many records you are pulling)&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 11:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772224#M59776</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2021-01-06T11:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772229#M59777</link>
      <description>&lt;P&gt;it processes 60k records in 4 min and then with every record becoming slower...&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 11:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772229#M59777</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2021-01-06T11:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772242#M59778</link>
      <description>&lt;P&gt;Hi! A way to reduce many loops is to replace entire Do While..Loop section with something like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Concatenate [Employee Attendance Hour Track]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load '$(vAttendanceDate)' as [Date1], '$(vEmployeeId)' as [EmpId], &lt;STRONG&gt;Hour&lt;/STRONG&gt; as [Hour1], $(i) as i, $(vMyRecordNo) as MyRecordNo &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RESIDENT Hours&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;WHERE Hour &amp;gt;= $(vStart) AND Hour&amp;lt;=$(vEnd);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You must create a table &lt;STRONG&gt;Hours&lt;/STRONG&gt; with a field &lt;STRONG&gt;Hour&lt;/STRONG&gt; from 0 to 23. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note that only works fine if end hour is within the same day (&amp;lt;24).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think, in 8 hours working days, you can reduce loops up to 88%...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards, Fernando&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 13:10:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772242#M59778</guid>
      <dc:creator>Fernando_Fabregas</dc:creator>
      <dc:date>2021-01-06T13:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772377#M59788</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49623"&gt;@madnanansari&lt;/a&gt;&amp;nbsp; may be try below. make sure that all your Dates or timestamp fields are in proper format.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Data:
LOAD Emp_ID,
     Attendence_Date,
     hour(Period_Start)+iterno()-1 as Hours
     Period_Start,
     Period_End
FROM Table
while hour(Period_Start)+iterno()-1&amp;lt;= hour(Period_End);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 22:36:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772377#M59788</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2021-01-06T22:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772383#M59790</link>
      <description>&lt;P&gt;I would use IntervalMatch() with that Hours table. No loops.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 23:31:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772383#M59790</guid>
      <dc:creator>Lucian</dc:creator>
      <dc:date>2021-01-06T23:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772393#M59792</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49623"&gt;@madnanansari&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I implemented&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;solution into the attached solution; I added an additional presentation of the data, as you will find out if you look at the application!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Attendance_01.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/46514iC4715C5A8E8FC469/image-size/large?v=v2&amp;amp;px=999" role="button" title="Attendance_01.png" alt="Attendance_01.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 02:59:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1772393#M59792</guid>
      <dc:creator>ArnadoSandoval</dc:creator>
      <dc:date>2021-01-07T02:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1773932#M59932</link>
      <description>&lt;P&gt;Hello Fernando, this will not work. This is 24x7 operation so night shift starts at 7 and end at 7 morning at some places.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 07:58:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1773932#M59932</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2021-01-13T07:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1774358#M59975</link>
      <description>&lt;P&gt;Hello Arnado,&lt;/P&gt;&lt;P&gt;I am working on a supermarket data which works 24x7 so Some people shift starts at 7Am and some in the evening at 7PM. If you can change the code accordingly?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 12:17:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1774358#M59975</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2021-01-14T12:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1774633#M60007</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49623"&gt;@madnanansari&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should describe your problem trully, without leaving any details out; I don't understand why you did noy try to extended the application I attached (Z_Attendance_01.qvf) one of the Qlik Community functions is to guide developers like you to understand and learn the product; this is not a "Hire a Qlik Developer" Community, if that is what you are looking for, post your question in those sites the offer "Developers for Hire".&lt;/P&gt;&lt;P&gt;Now going back to your question, as I already upload the application: Z_Attendance_01.qvf&amp;nbsp; Would you please ask a question based on where in its script you are experiencing difficulties? or clearly ask for the application to be fully written for you?&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 04:02:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1774633#M60007</guid>
      <dc:creator>ArnadoSandoval</dc:creator>
      <dc:date>2021-01-15T04:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Peek is slow. Any workaround?</title>
      <link>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1774645#M60008</link>
      <description>&lt;P&gt;I think you could make a join between 2 tables:&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;Load Date, Hour resident date_hour;&lt;/P&gt;&lt;P&gt;output join&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Employee Id, Attendance date, Date , TimeIn,TimeOut;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Noconcatenate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Load *,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if (hour &amp;gt;=TimeIn and hour &amp;lt;=TimeOut, 1, 0 ) as IsBuildHour;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;resident&amp;nbsp;Temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Use column&amp;nbsp;IsBuildHour = 1 to get your result.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 06:09:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Peek-is-slow-Any-workaround/m-p/1774645#M60008</guid>
      <dc:creator>thi_pham</dc:creator>
      <dc:date>2021-01-15T06:09:11Z</dc:date>
    </item>
  </channel>
</rss>

