<?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: Automatic qvd creation in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Automatic-qvd-creation/m-p/2482225#M100911</link>
    <description>&lt;P&gt;Try below code&lt;/P&gt;
&lt;P&gt;// Step 1: Load the data from CSV files&lt;/P&gt;
&lt;P&gt;TempData:&lt;/P&gt;
&lt;P&gt;LOAD Distinct&lt;/P&gt;
&lt;P&gt;MonthStart(Start_Timestamp, 'YYYY-MM') AS MonthField&lt;/P&gt;
&lt;P&gt;FROM [$(vBLR_PATH)Self Serv Report/IFR/INTERACTION_FLOW_REPORT_*.csv]&lt;/P&gt;
&lt;P&gt;(txt, codepage is 28591, embedded labels, delimiter is ',', msq);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Step 2: Iterate over the distinct months&lt;BR /&gt;For i=0 to NoOfRows('TempData')&lt;/P&gt;
&lt;P&gt;Let Monthfield =Peek('MonthField',$(i),'TempData');&lt;/P&gt;
&lt;P&gt;// Step 3: Create a new dataset for each month&lt;BR /&gt;MonthData:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD * &lt;BR /&gt;FROM [$(vBLR_PATH)Self Serv Report/IFR/INTERACTION_FLOW_REPORT_*.csv]&lt;BR /&gt;WHERE MonthStart(Start_Timestamp, 'YYYY-MM') = '$(Monthfield)';&lt;/P&gt;
&lt;P&gt;// Step 4: Store the data for the current month into a QVD&lt;BR /&gt;STORE MonthData INTO [$(vQVD_PATH)Self Serv/IFR_$(Monthfield)_new.qvd] (qvd);&lt;/P&gt;
&lt;P&gt;// Step 5: Drop the temporary month data&lt;/P&gt;
&lt;P&gt;DROP TABLE MonthData;&lt;/P&gt;
&lt;P&gt;Next i;&lt;/P&gt;
&lt;P&gt;// Step 6: Clean up TempData&lt;/P&gt;
&lt;P&gt;DROP TABLE TempData;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Prashant Sangle&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2024 10:01:14 GMT</pubDate>
    <dc:creator>PrashantSangle</dc:creator>
    <dc:date>2024-09-18T10:01:14Z</dc:date>
    <item>
      <title>Automatic qvd creation</title>
      <link>https://community.qlik.com/t5/App-Development/Automatic-qvd-creation/m-p/2482208#M100906</link>
      <description>&lt;P&gt;// Step 1: Load the data from CSV files&lt;/P&gt;
&lt;P&gt;TempData:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Date(Start_Timestamp, 'YYYY-MM') AS MonthField&lt;/P&gt;
&lt;P&gt;FROM [$(vBLR_PATH)Self Serv Report/IFR/INTERACTION_FLOW_REPORT_*.csv]&lt;/P&gt;
&lt;P&gt;(txt, codepage is 28591, embedded labels, delimiter is ',', msq);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Step 2: Iterate over the distinct months&lt;/P&gt;
&lt;P&gt;FOR EACH _month IN FieldValueList('MonthField')&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; LET vYearMonth = _month;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; TRACE Processing Month: $(vYearMonth); // Add logging for debug&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; // Step 3: Create a new dataset for each month&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; MonthData:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; NoConcatenate&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; LOAD *&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; RESIDENT TempData&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; WHERE Date(Start_Timestamp, 'YYYY-MM') = '$(vYearMonth)';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; TRACE Storing Month Data for: $(vYearMonth); // Add logging for debug&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; // Step 4: Store the data for the current month into a QVD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; STORE MonthData INTO [$(vQVD_PATH)Self Serv/IFR_$(vYearMonth)_new.qvd] (qvd);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; // Step 5: Drop the temporary month data&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; DROP TABLE MonthData;&lt;/P&gt;
&lt;P&gt;NEXT _month;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Step 6: Clean up TempData&lt;/P&gt;
&lt;P&gt;DRO&lt;/P&gt;
&lt;P&gt;P TABLE TempData;&lt;/P&gt;
&lt;P&gt;Will this script works&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EXIT SCRIPT;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 09:19:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Automatic-qvd-creation/m-p/2482208#M100906</guid>
      <dc:creator>Raju_6952</dc:creator>
      <dc:date>2024-09-18T09:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic qvd creation</title>
      <link>https://community.qlik.com/t5/App-Development/Automatic-qvd-creation/m-p/2482225#M100911</link>
      <description>&lt;P&gt;Try below code&lt;/P&gt;
&lt;P&gt;// Step 1: Load the data from CSV files&lt;/P&gt;
&lt;P&gt;TempData:&lt;/P&gt;
&lt;P&gt;LOAD Distinct&lt;/P&gt;
&lt;P&gt;MonthStart(Start_Timestamp, 'YYYY-MM') AS MonthField&lt;/P&gt;
&lt;P&gt;FROM [$(vBLR_PATH)Self Serv Report/IFR/INTERACTION_FLOW_REPORT_*.csv]&lt;/P&gt;
&lt;P&gt;(txt, codepage is 28591, embedded labels, delimiter is ',', msq);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Step 2: Iterate over the distinct months&lt;BR /&gt;For i=0 to NoOfRows('TempData')&lt;/P&gt;
&lt;P&gt;Let Monthfield =Peek('MonthField',$(i),'TempData');&lt;/P&gt;
&lt;P&gt;// Step 3: Create a new dataset for each month&lt;BR /&gt;MonthData:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD * &lt;BR /&gt;FROM [$(vBLR_PATH)Self Serv Report/IFR/INTERACTION_FLOW_REPORT_*.csv]&lt;BR /&gt;WHERE MonthStart(Start_Timestamp, 'YYYY-MM') = '$(Monthfield)';&lt;/P&gt;
&lt;P&gt;// Step 4: Store the data for the current month into a QVD&lt;BR /&gt;STORE MonthData INTO [$(vQVD_PATH)Self Serv/IFR_$(Monthfield)_new.qvd] (qvd);&lt;/P&gt;
&lt;P&gt;// Step 5: Drop the temporary month data&lt;/P&gt;
&lt;P&gt;DROP TABLE MonthData;&lt;/P&gt;
&lt;P&gt;Next i;&lt;/P&gt;
&lt;P&gt;// Step 6: Clean up TempData&lt;/P&gt;
&lt;P&gt;DROP TABLE TempData;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Prashant Sangle&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 10:01:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Automatic-qvd-creation/m-p/2482225#M100911</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2024-09-18T10:01:14Z</dc:date>
    </item>
  </channel>
</rss>

