<?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 with expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/726908#M1067989</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have a function in Excel that i would like to implement in qlikview. In my sheet there's a table as presented below&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen1.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/66085_screen1.PNG.png" /&gt;&lt;/P&gt;&lt;P&gt;And here are the functions:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen2.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/66140_screen2.PNG.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont have an idea how to calculate expression for active column. I tried to use &lt;EM&gt;Above&lt;/EM&gt; but it didn't really work well : &lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen3.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/66141_screen3.PNG.png" /&gt;&lt;/P&gt;&lt;P&gt;as you can see, first row is correct, second also, but in third the value in active should be equal to 1, instead it shows 0 because above function sees 9-9=0 equation and don't remember about this '1' which left from previous row. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to fix this ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Sep 2014 11:19:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-09-07T11:19:28Z</dc:date>
    <item>
      <title>Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/726908#M1067989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have a function in Excel that i would like to implement in qlikview. In my sheet there's a table as presented below&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen1.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/66085_screen1.PNG.png" /&gt;&lt;/P&gt;&lt;P&gt;And here are the functions:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen2.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/66140_screen2.PNG.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont have an idea how to calculate expression for active column. I tried to use &lt;EM&gt;Above&lt;/EM&gt; but it didn't really work well : &lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen3.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/66141_screen3.PNG.png" /&gt;&lt;/P&gt;&lt;P&gt;as you can see, first row is correct, second also, but in third the value in active should be equal to 1, instead it shows 0 because above function sees 9-9=0 equation and don't remember about this '1' which left from previous row. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to fix this ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Sep 2014 11:19:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/726908#M1067989</guid>
      <dc:creator />
      <dc:date>2014-09-07T11:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/726909#M1067990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this script which gives the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *,If(IsNull(Peek('active')),new-finished,Peek('active')+new-finished) as active;&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Week,new,finished&lt;/P&gt;&lt;P&gt;W06,6,3&lt;/P&gt;&lt;P&gt;W07,9,3&lt;/P&gt;&lt;P&gt;W08,4,3&lt;/P&gt;&lt;P&gt;W09,9,2&lt;/P&gt;&lt;P&gt;W10,13,6&lt;/P&gt;&lt;P&gt;W11,11,14&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/66146_Capture.PNG.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Sep 2014 11:33:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/726909#M1067990</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2014-09-07T11:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/726910#M1067991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one solution with calculations in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14100900474566655" jivemacro_uid="_14100900474566655"&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alt(Peek(active),0)+(new-finished) as active&lt;/P&gt;
&lt;P&gt;INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; week, new, finished&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; W06, 6, 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; W07, 9, 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; W08, 4, 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; W09, 9, 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; W10, 13, 6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; W11, 11, 14&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Sep 2014 11:39:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/726910#M1067991</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-09-07T11:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/726911#M1067992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another one creating a calendar table with your date_new and date_finished fields to generate combined week and date fields for both events.&lt;/P&gt;&lt;P&gt;The count of new and finished events per week can then be done using this week and canonical date field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="66157" alt="QlikCommunity_Thread_132254_Pic4.JPG.jpg" class="jive-image jiveImage" src="https://community.qlik.com/legacyfs/online/66157_QlikCommunity_Thread_132254_Pic4.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="66155" alt="QlikCommunity_Thread_132254_Pic2.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/66155_QlikCommunity_Thread_132254_Pic2.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="66156" alt="QlikCommunity_Thread_132254_Pic3.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/66156_QlikCommunity_Thread_132254_Pic3.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="66158" alt="QlikCommunity_Thread_132254_Pic5.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/66158_QlikCommunity_Thread_132254_Pic5.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="66159" alt="QlikCommunity_Thread_132254_Pic8.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/66159_QlikCommunity_Thread_132254_Pic8.JPG.jpg" style="width: 620px; height: 177px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="66160" alt="QlikCommunity_Thread_132254_Pic6.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/66160_QlikCommunity_Thread_132254_Pic6.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="66161" alt="QlikCommunity_Thread_132254_Pic7.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/66161_QlikCommunity_Thread_132254_Pic7.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14100931342952752 jive_text_macro jive_macro_code" jivemacro_uid="_14100931342952752"&gt;
&lt;P&gt;tabData:&lt;/P&gt;
&lt;P&gt;LOAD RecNo() as ID,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#('01/01/2014', 'MM/DD/YYYY')+Ceil(Rand()*250)) as date_new,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#('01/01/2014', 'MM/DD/YYYY')+Ceil(Rand()*250)) as date_finished&lt;/P&gt;
&lt;P&gt;AutoGenerate 100;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabCalendar:&lt;/P&gt;
&lt;P&gt;CrossTable (FieldName, Date)&lt;/P&gt;
&lt;P&gt;LOAD * Resident tabData;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabCalendar)&lt;/P&gt;
&lt;P&gt;LOAD Distinct&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Dual('W'&amp;amp;Num(Week(Date), '00'), WeekStart(Date)) as Week&lt;/P&gt;
&lt;P&gt;Resident tabCalendar;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabCalendar)&lt;/P&gt;
&lt;P&gt;LOAD Distinct&lt;/P&gt;
&lt;P&gt;&amp;nbsp; FieldName,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SubField(FieldName, '_', 2) as DateType&lt;/P&gt;
&lt;P&gt;Resident tabCalendar;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Field FieldName;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Sep 2014 12:25:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/726911#M1067992</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-09-07T12:25:31Z</dc:date>
    </item>
  </channel>
</rss>

