<?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: Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script/m-p/1654300#M448048</link>
    <description>&lt;P&gt;In the previous version where we worked on this on the front end, we compared two dates when we saw the output... what two dates are you comparing here?&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 19:36:31 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2019-12-04T19:36:31Z</dc:date>
    <item>
      <title>Script</title>
      <link>https://community.qlik.com/t5/QlikView/Script/m-p/1648882#M447700</link>
      <description>&lt;P&gt;Script:&lt;/P&gt;&lt;P&gt;tempData:&lt;BR /&gt;Directory;&lt;BR /&gt;LOAD Date,&lt;BR /&gt;ID,&lt;BR /&gt;Name,&lt;BR /&gt;Status&lt;BR /&gt;FROM&lt;BR /&gt;[Add,Remove,Replace.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;DataDate:&lt;BR /&gt;load distinct&lt;BR /&gt;Date&lt;BR /&gt;resident tempData;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;maxDate:&lt;BR /&gt;load distinct&lt;BR /&gt;max(Date) as maxDate&lt;BR /&gt;resident tempData;&lt;/P&gt;&lt;P&gt;let vMax=peek('maxDate',0,'maxDate');&lt;BR /&gt;let vRow=NoOfRows('DataDate');&lt;BR /&gt;trace $(vMax);&lt;/P&gt;&lt;P&gt;drop table maxDate;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NoConcatenate&lt;BR /&gt;maxDate:&lt;BR /&gt;load Date as maxDate,&lt;BR /&gt;ID,&lt;BR /&gt;Name as maxName,&lt;BR /&gt;Status&lt;BR /&gt;resident tempData&lt;BR /&gt;where Date='$(vMax)';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for i=1 to $(vRow)&lt;BR /&gt;let vDate=peek('Date',$(i)-1,'DataDate');&lt;BR /&gt;trace $(vDate);&lt;BR /&gt;JOIN(maxDate)&lt;BR /&gt;Data1:&lt;BR /&gt;load '$(vDate)' as Date$(i),&lt;BR /&gt;ID,&lt;BR /&gt;Name as Name$(i),&lt;BR /&gt;Status&lt;BR /&gt;RESIDENT tempData&lt;BR /&gt;where Date= '$(vDate)'&lt;BR /&gt;and Date&amp;lt;&amp;gt;'$(vMax)';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;tempDate:&lt;BR /&gt;load Date,ID,Flag,Status,if(Added=1,'Added',if(Renamed=1,'Renamed',if(Removed=1,'Removed',null())))as Measures;&lt;BR /&gt;load&lt;BR /&gt;if(isnull(Date$(i)),'$(vDate)',Date$(i)) as Date,&lt;BR /&gt;ID,&lt;BR /&gt;'$(i)' as Flag,&lt;BR /&gt;Status,&lt;BR /&gt;if(isnull(Date$(i)),1,0) as Added,&lt;BR /&gt;maxName,&lt;BR /&gt;Name$(i),&lt;BR /&gt;if( (isnull(maxDate)and not isnull(Date$(i))and isnull(maxName)),1,0) as Removed,&lt;BR /&gt;if(Name$(i)&amp;lt;&amp;gt;maxName and not isnull(maxName),1,0)as Renamed&lt;BR /&gt;resident maxDate;&lt;BR /&gt;set vMaxFlag=$(i);&lt;BR /&gt;next i&lt;BR /&gt;drop table tempData;&lt;BR /&gt;drop table maxDate;&lt;BR /&gt;exit script;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;Added:&lt;/P&gt;&lt;P&gt;count({&amp;lt;Measures={'Added'}&amp;gt;}if(Flag&amp;lt;&amp;gt;$(vMaxFlag),Measures))&lt;/P&gt;&lt;P&gt;Removed:&lt;/P&gt;&lt;P&gt;count({&amp;lt;Measures={'Removed'}&amp;gt;}if(Flag=$(vMaxFlag),0,Measures))&lt;/P&gt;&lt;P&gt;Renamed:&lt;/P&gt;&lt;P&gt;count({&amp;lt;Measures={'Renamed'}&amp;gt;}if(Flag=$(vMaxFlag),0,Measures))&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 07:51:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script/m-p/1648882#M447700</guid>
      <dc:creator>mahitham</dc:creator>
      <dc:date>2019-11-20T07:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.qlik.com/t5/QlikView/Script/m-p/1649062#M447706</link>
      <description>&lt;P&gt;Would you be able to add a sample app?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 12:13:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script/m-p/1649062#M447706</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-11-20T12:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.qlik.com/t5/QlikView/Script/m-p/1649126#M447707</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp; attached the app and Excel below.&lt;/P&gt;&lt;P&gt;In Original data the above script is not working in all cases.&lt;/P&gt;&lt;P&gt;In the below sample chart also on 19/10/2019 the Added count is getting 9 instead of 8.&lt;/P&gt;&lt;P&gt;Could you please help me to change the above script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="add issue.png" style="width: 698px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24068iF033C9BE2E7D7D82/image-size/large?v=v2&amp;amp;px=999" role="button" title="add issue.png" alt="add issue.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 13:33:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script/m-p/1649126#M447707</guid>
      <dc:creator>mahitham</dc:creator>
      <dc:date>2019-11-20T13:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.qlik.com/t5/QlikView/Script/m-p/1654300#M448048</link>
      <description>&lt;P&gt;In the previous version where we worked on this on the front end, we compared two dates when we saw the output... what two dates are you comparing here?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 19:36:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script/m-p/1654300#M448048</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-12-04T19:36:31Z</dc:date>
    </item>
  </channel>
</rss>

