<?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 AW:Timeline problem - calculation during skript loading in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Timeline-problem-calculation-during-skript-loading/m-p/196583#M56589</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;Its solved within the follwing code:&lt;/P&gt;&lt;P&gt;TABLE_I:&lt;BR /&gt;// generate start time&lt;BR /&gt;//Load *&lt;BR /&gt;// , if(RowNo()=1, H_CUTOFF_TIME - (H_DURATION / 86400), Previous(H_STARTTIME) - (H_DURATION / 86400)) as H_STARTTIME&lt;BR /&gt;//;&lt;BR /&gt;Load*&lt;BR /&gt; , H_END - (H_DURATION / 86400) as H_BEGIN&lt;BR /&gt;;&lt;BR /&gt;Load *&lt;BR /&gt; , if(H_CUTOFF_TIME &amp;gt; peek(H_BEGIN) and H_CUTOFF_DATE=Previous(H_CUTOFF_DATE), previous(H_CUTOFF_TIME) - ((H_SUMTIME - H_DURATION)/86400), H_CUTOFF_TIME) as H_END&lt;BR /&gt;;&lt;BR /&gt;Load *&lt;BR /&gt; // same Cutoff-date&lt;BR /&gt; , if(H_CUTOFF_DATE=Previous(H_CUTOFF_DATE),&lt;BR /&gt; // and same Cutoff-time&lt;BR /&gt; if (H_CUTOFF_TIME=Previous(H_CUTOFF_TIME),&lt;BR /&gt; //sum the duration&lt;BR /&gt; numsum(H_DURATION, peek('H_SUMTIME')),&lt;BR /&gt; //CUTOFF time not equal&lt;BR /&gt; if (H_CUTOFF_TIME &amp;gt; peek(H_BEGIN),&lt;BR /&gt; numsum(H_DURATION, peek('H_SUMTIME')),&lt;BR /&gt; H_DURATION)),&lt;BR /&gt; // if the date changes remeber only the duration&lt;BR /&gt; H_DURATION)&lt;BR /&gt; as H_SUMTIME&lt;BR /&gt;;&lt;BR /&gt;//Load *&lt;BR /&gt;// , if(H_CUTOFF_DATE=Previous(H_CUTOFF_DATE) and H_CUTOFF_TIME=Previous(H_CUTOFF_TIME),&lt;BR /&gt;// numsum(H_DURATION, peek('H_SUMTIME')),H_DURATION) as H_SUMTIME&lt;BR /&gt;//;&lt;BR /&gt;// load only workpackages&lt;BR /&gt;// load only header&lt;BR /&gt;Load PRLFDN //to connect to the origin database&lt;BR /&gt; , PRRNR as H_PRPRN&lt;BR /&gt; , PRRETI as H_DURATION&lt;BR /&gt; , date#(PRDTB, 'YYYYMMDD') as H_CUTOFF_DATE&lt;BR /&gt; , time#(num(PRTIB, '000000'), 'hhmmss') as H_CUTOFF_TIME&lt;BR /&gt;Resident PRMPROC where PRRCTYP='WP' and PRWSTP = ' ' order by PRDTB desc, PRTIB desc;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Nov 2010 15:56:31 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-11-22T15:56:31Z</dc:date>
    <item>
      <title>Timeline problem - calculation during skript loading</title>
      <link>https://community.qlik.com/t5/QlikView/Timeline-problem-calculation-during-skript-loading/m-p/196582#M56588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;Dear Community,&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;I have a problem with visualization of certain data in QlikView. It is not easy to describe where the problem realy is, but I try my very best.&lt;BR /&gt;In the external database the following data were given:&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;&lt;A id="OLE_LINK2" name="OLE_LINK2"&gt;&lt;/A&gt;&lt;A id="OLE_LINK1" name="OLE_LINK1"&gt;Order Cutoff_date Cutoff_time Duration&lt;BR /&gt;A 20101126 170000 120&lt;BR /&gt;B 20101126 170000 180&lt;BR /&gt;C 20101126 170000 960&lt;BR /&gt;D 20101126 170000 150&lt;BR /&gt;E 20101126 150000 120&lt;BR /&gt;F 20101126 150000 180&lt;BR /&gt;G 20101129 170000 480&lt;BR /&gt;H 20101129 170000 240&lt;BR /&gt;I 20101129 170000 60&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;During script loading the following data should been calculated:&lt;BR /&gt;End_time:&lt;BR /&gt;Here the end of one order should been calculated - take last Start_time (except first record of each day here the cutoff_time should been taken).&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;Start_time:&lt;BR /&gt;Here the start time of one order should been calculated - end_time minus duration.&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;And here is the problem both "new" fields depend each other - an error-message appears.&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;The result after the loading process should be:&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;Order Cutoff_date Cutoff_time Duration Beginn End&lt;BR /&gt;A 20101126 170000 120 165800 170000&lt;BR /&gt;B 20101126 170000 180 165500 165800&lt;BR /&gt;C 20101126 170000 960 163900 165500&lt;BR /&gt;D 20101126 170000 150 163630 163900&lt;BR /&gt;E 20101126 150000 120 145800 150000&lt;BR /&gt;F 20101126 150000 180 145500 145800&lt;BR /&gt;G 20101129 170000 480 165200 170000&lt;BR /&gt;H 20101129 170000 240 164800 165200&lt;BR /&gt;I 20101129 170000 60 164700 164800&lt;/P&gt;&lt;P&gt;But if I add the following code to the script QilkView get the respond that the field does not exist.&lt;BR /&gt;TABLE_I:&lt;/P&gt;&lt;P&gt;// generate start time&lt;/P&gt;&lt;P&gt;&lt;B&gt;Load&lt;/B&gt; *&lt;/P&gt;&lt;P&gt;, if(RowNo()=1, H_CUTOFF_TIME - (H_DURATION / 86400), Previous(H_START_TIME) - (H_DURATION / 86400)) as H_START_TIME&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;// load only header&lt;/P&gt;&lt;P&gt;&lt;B&gt;Load&lt;/B&gt; PRLFDN //to connect to the origin database&lt;/P&gt;&lt;P&gt;, ORDER as H_ORDER&lt;/P&gt;&lt;P&gt;, PRRETI as H_DURATION&lt;/P&gt;&lt;P&gt;, date#(PRDTB, 'YYYYMMDD') as H_CUTOFF_DATE&lt;/P&gt;&lt;P&gt;, time#(num(PRTIB, '000000'), 'hhmmss') as H_CUTOFF_TIME&lt;/P&gt;&lt;P&gt;Resident TABLE where FIELD1='WP' and FIELD2 = ' ' order by ORDERDATE desc, ORDERTIME desc;&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;Is there anyone who had a similar problem?&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;I tried to use variables but it doesn't work to set a variable dynamic during the loadprocess.&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;Next challenge is to make a visualization to that data!&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;Kind regards.&lt;/P&gt;&lt;P style="margin: 6pt 0cm; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;Martin Brunkalla&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Nov 2010 11:43:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Timeline-problem-calculation-during-skript-loading/m-p/196582#M56588</guid>
      <dc:creator />
      <dc:date>2010-11-22T11:43:36Z</dc:date>
    </item>
    <item>
      <title>AW:Timeline problem - calculation during skript loading</title>
      <link>https://community.qlik.com/t5/QlikView/Timeline-problem-calculation-during-skript-loading/m-p/196583#M56589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;Its solved within the follwing code:&lt;/P&gt;&lt;P&gt;TABLE_I:&lt;BR /&gt;// generate start time&lt;BR /&gt;//Load *&lt;BR /&gt;// , if(RowNo()=1, H_CUTOFF_TIME - (H_DURATION / 86400), Previous(H_STARTTIME) - (H_DURATION / 86400)) as H_STARTTIME&lt;BR /&gt;//;&lt;BR /&gt;Load*&lt;BR /&gt; , H_END - (H_DURATION / 86400) as H_BEGIN&lt;BR /&gt;;&lt;BR /&gt;Load *&lt;BR /&gt; , if(H_CUTOFF_TIME &amp;gt; peek(H_BEGIN) and H_CUTOFF_DATE=Previous(H_CUTOFF_DATE), previous(H_CUTOFF_TIME) - ((H_SUMTIME - H_DURATION)/86400), H_CUTOFF_TIME) as H_END&lt;BR /&gt;;&lt;BR /&gt;Load *&lt;BR /&gt; // same Cutoff-date&lt;BR /&gt; , if(H_CUTOFF_DATE=Previous(H_CUTOFF_DATE),&lt;BR /&gt; // and same Cutoff-time&lt;BR /&gt; if (H_CUTOFF_TIME=Previous(H_CUTOFF_TIME),&lt;BR /&gt; //sum the duration&lt;BR /&gt; numsum(H_DURATION, peek('H_SUMTIME')),&lt;BR /&gt; //CUTOFF time not equal&lt;BR /&gt; if (H_CUTOFF_TIME &amp;gt; peek(H_BEGIN),&lt;BR /&gt; numsum(H_DURATION, peek('H_SUMTIME')),&lt;BR /&gt; H_DURATION)),&lt;BR /&gt; // if the date changes remeber only the duration&lt;BR /&gt; H_DURATION)&lt;BR /&gt; as H_SUMTIME&lt;BR /&gt;;&lt;BR /&gt;//Load *&lt;BR /&gt;// , if(H_CUTOFF_DATE=Previous(H_CUTOFF_DATE) and H_CUTOFF_TIME=Previous(H_CUTOFF_TIME),&lt;BR /&gt;// numsum(H_DURATION, peek('H_SUMTIME')),H_DURATION) as H_SUMTIME&lt;BR /&gt;//;&lt;BR /&gt;// load only workpackages&lt;BR /&gt;// load only header&lt;BR /&gt;Load PRLFDN //to connect to the origin database&lt;BR /&gt; , PRRNR as H_PRPRN&lt;BR /&gt; , PRRETI as H_DURATION&lt;BR /&gt; , date#(PRDTB, 'YYYYMMDD') as H_CUTOFF_DATE&lt;BR /&gt; , time#(num(PRTIB, '000000'), 'hhmmss') as H_CUTOFF_TIME&lt;BR /&gt;Resident PRMPROC where PRRCTYP='WP' and PRWSTP = ' ' order by PRDTB desc, PRTIB desc;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Nov 2010 15:56:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Timeline-problem-calculation-during-skript-loading/m-p/196583#M56589</guid>
      <dc:creator />
      <dc:date>2010-11-22T15:56:31Z</dc:date>
    </item>
  </channel>
</rss>

