<?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: QlikSense Conditional Code in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/QlikSense-Conditional-Code/m-p/1637154#M47487</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;maybe something like this could work:&lt;/P&gt;&lt;P&gt;Set vStartYear = 2018;&lt;BR /&gt;Set vStartMonth = 5;&lt;BR /&gt;Let vCurrentYear= Year(Now());&lt;/P&gt;&lt;P&gt;Let vStartQvd = Date(MakeDate($(vStartYear),$(vStartMonth)),'YYYYMM');&lt;/P&gt;&lt;P&gt;FOR Each File in FileList('[lib://CID/AUXFILE_*.qvd]')&lt;/P&gt;&lt;P&gt;TABLE_temp:&lt;BR /&gt;LOAD&lt;BR /&gt;SubField(Mid('$(File)',Index('$(File)','AUXFILE_')),'_',2) &amp;amp;&lt;BR /&gt;Left(SubField(Mid('$(File)',Index('$(File)','AUXFILE_')),'_',3),2) as YearMonth,&lt;BR /&gt;SubField(Mid('$(File)',Index('$(File)','AUXFILE_')),'_',2) as Year,&lt;BR /&gt;'$(File)' as File&lt;BR /&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;For vYear = '$(vStartYear)' to '$(vCurrentYear)'&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;TABLE_$(vYear):&lt;BR /&gt;LOAD File&lt;BR /&gt;Resident TABLE_temp&lt;BR /&gt;Where YearMonth&amp;gt;$(vStartQvd) and Year=$(vYear);&lt;/P&gt;&lt;P&gt;FOR i=0 to NoOfRows('TABLE_$(vYear)')-1&lt;/P&gt;&lt;P&gt;LET vQvd = Peek('File',$(i),'TABLE_$(vYear)');&lt;/P&gt;&lt;P&gt;DTA_$(vYear):&lt;BR /&gt;LOAD&lt;BR /&gt;ID,&lt;BR /&gt;Region,&lt;BR /&gt;Country&lt;BR /&gt;From $(vQvd) (qvd);&lt;/P&gt;&lt;P&gt;STORE DTA_$(vYear) into DTA_$(vYear);&lt;/P&gt;&lt;P&gt;DROP Table DTA_$(vYear);&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;DROP Table TABLE_temp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2019 12:20:15 GMT</pubDate>
    <dc:creator>StarinieriG</dc:creator>
    <dc:date>2019-10-18T12:20:15Z</dc:date>
    <item>
      <title>QlikSense Conditional Code</title>
      <link>https://community.qlik.com/t5/App-Development/QlikSense-Conditional-Code/m-p/1636748#M47437</link>
      <description>&lt;P&gt;I have below qvd files in my library location. I only want to load data from 2018_05 to rest all. How to transform my existing code(Given below)?&lt;/P&gt;&lt;P&gt;AUXFILE_2018_03.qvd&lt;BR /&gt;AUXFILE_2018_04.qvd&lt;BR /&gt;AUXFILE_2018_05.qvd&lt;BR /&gt;AUXFILE_2018_06.qvd&lt;BR /&gt;AUXFILE_2018_07.qvd&lt;BR /&gt;AUXFILE_2018_08.qvd&lt;BR /&gt;AUXFILE_2018_09.qvd&lt;BR /&gt;AUXFILE_2018_10.qvd&lt;BR /&gt;AUXFILE_2018_11.qvd&lt;BR /&gt;AUXFILE_2018_12.qvd&lt;BR /&gt;AUXFILE_2019_01.qvd&lt;BR /&gt;AUXFILE_2019_02.qvd&lt;BR /&gt;AUXFILE_2019_03.qvd&lt;BR /&gt;AUXFILE_2019_04.qvd&lt;BR /&gt;AUXFILE_2019_05.qvd&lt;BR /&gt;AUXFILE_2019_06.qvd&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;****My Code****&lt;/P&gt;&lt;P&gt;Set vStartYear = 2018;&lt;BR /&gt;Let vCurrentYear= year(now());&lt;BR /&gt;For vYear = $(vStartYear) to $(vCurrentYear)&lt;/P&gt;&lt;P&gt;DTA:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;ID,&lt;BR /&gt;Region,&lt;BR /&gt;Country&lt;/P&gt;&lt;P&gt;FROM [lib://CID/AUXFILE_$(vYear)*.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;store DTA into [lib://STR/DTA_$(vYear).qvd));&lt;/P&gt;&lt;P&gt;next vYear&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 13:59:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/QlikSense-Conditional-Code/m-p/1636748#M47437</guid>
      <dc:creator>Ron1</dc:creator>
      <dc:date>2019-10-17T13:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: QlikSense Conditional Code</title>
      <link>https://community.qlik.com/t5/App-Development/QlikSense-Conditional-Code/m-p/1636884#M47455</link>
      <description>&lt;P&gt;Can anyone please help on this&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 18:18:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/QlikSense-Conditional-Code/m-p/1636884#M47455</guid>
      <dc:creator>Ron1</dc:creator>
      <dc:date>2019-10-17T18:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: QlikSense Conditional Code</title>
      <link>https://community.qlik.com/t5/App-Development/QlikSense-Conditional-Code/m-p/1637154#M47487</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;maybe something like this could work:&lt;/P&gt;&lt;P&gt;Set vStartYear = 2018;&lt;BR /&gt;Set vStartMonth = 5;&lt;BR /&gt;Let vCurrentYear= Year(Now());&lt;/P&gt;&lt;P&gt;Let vStartQvd = Date(MakeDate($(vStartYear),$(vStartMonth)),'YYYYMM');&lt;/P&gt;&lt;P&gt;FOR Each File in FileList('[lib://CID/AUXFILE_*.qvd]')&lt;/P&gt;&lt;P&gt;TABLE_temp:&lt;BR /&gt;LOAD&lt;BR /&gt;SubField(Mid('$(File)',Index('$(File)','AUXFILE_')),'_',2) &amp;amp;&lt;BR /&gt;Left(SubField(Mid('$(File)',Index('$(File)','AUXFILE_')),'_',3),2) as YearMonth,&lt;BR /&gt;SubField(Mid('$(File)',Index('$(File)','AUXFILE_')),'_',2) as Year,&lt;BR /&gt;'$(File)' as File&lt;BR /&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;For vYear = '$(vStartYear)' to '$(vCurrentYear)'&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;TABLE_$(vYear):&lt;BR /&gt;LOAD File&lt;BR /&gt;Resident TABLE_temp&lt;BR /&gt;Where YearMonth&amp;gt;$(vStartQvd) and Year=$(vYear);&lt;/P&gt;&lt;P&gt;FOR i=0 to NoOfRows('TABLE_$(vYear)')-1&lt;/P&gt;&lt;P&gt;LET vQvd = Peek('File',$(i),'TABLE_$(vYear)');&lt;/P&gt;&lt;P&gt;DTA_$(vYear):&lt;BR /&gt;LOAD&lt;BR /&gt;ID,&lt;BR /&gt;Region,&lt;BR /&gt;Country&lt;BR /&gt;From $(vQvd) (qvd);&lt;/P&gt;&lt;P&gt;STORE DTA_$(vYear) into DTA_$(vYear);&lt;/P&gt;&lt;P&gt;DROP Table DTA_$(vYear);&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;DROP Table TABLE_temp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 12:20:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/QlikSense-Conditional-Code/m-p/1637154#M47487</guid>
      <dc:creator>StarinieriG</dc:creator>
      <dc:date>2019-10-18T12:20:15Z</dc:date>
    </item>
  </channel>
</rss>

