<?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: Extracting data for last 3 years from SAP in Qlikview using Loops in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748763#M57563</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/103918"&gt;@Aspiring_Developer&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let vMin = addyears(yearstart(Today()),-3);
let vMax = monthstart(Today());

Months:
LOAD date(AddMonths('$(vMin)',IterNo()-1),'YYYYMM') as Months
AutoGenerate 1
while AddMonths('$(vMin)',IterNo()-1)&amp;lt;= '$(vMax)';

for i=1 to FieldValueCount('Months')

let vYearMonth = FieldValue('Months',$(i));

Data:
Select ...

Variables (
[!V000004] (I = [0CALMONTH].[$(vYearMonth)])),
From (ZOE_MP01/ZOE_MP01_Q005_OS));

Store Data into C:\$(vYearMonth).qvd; // change QVD path here

DROP Table Data;

NEXT

DROP Table Months;&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 01 Oct 2020 10:29:12 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2020-10-01T10:29:12Z</dc:date>
    <item>
      <title>Extracting data for last 3 years from SAP in Qlikview using Loops</title>
      <link>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748696#M57554</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Please help me with the below:-&lt;/P&gt;&lt;P&gt;I am fetching the data from SAP to Qlikview . Requirement is:-&lt;/P&gt;&lt;P&gt;-Fetch the data for last 3 yearmonths (201703 to 202006) and (202006 should be dynamic ) using loop:-&lt;/P&gt;&lt;P&gt;I have done below :-&lt;/P&gt;&lt;P&gt;for VYearMonth= 201703 to 202006&lt;/P&gt;&lt;P&gt;Load&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select ...&lt;/P&gt;&lt;P&gt;Variables (&lt;BR /&gt;[!V000004] (I = [0CALMONTH].[$(VYearMonth)])),&lt;BR /&gt;From (ZOE_MP01/ZOE_MP01_Q005_OS));&lt;BR /&gt;&lt;BR /&gt;next VYearMonth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the result to be dynamic for 202006 and post storing the table into QVD, we have to split the QVD's for each year month like 201703 qvd, 201702 qvd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please help ?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748696#M57554</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2024-11-16T18:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data for last 3 years from SAP in Qlikview using Loops</title>
      <link>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748744#M57557</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/103918"&gt;@Aspiring_Developer&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;sub MonthlyLoad (_vStart,_End)

let vMin = MonthStart(date#(_vStart,'YYYYMM'));
let vMax = MonthStart(date#(_End,'YYYYMM'));

Months:
LOAD date(AddMonths('$(vMin)',IterNo()-1),'YYYYMM') as Months
AutoGenerate 1
while AddMonths('$(vMin)',IterNo()-1)&amp;lt;= '$(vMax)';

for i=1 to FieldValueCount('Months')

let vYearMonth = FieldValue('Months',$(i));

Data:
Select ...

Variables (
[!V000004] (I = [0CALMONTH].[$(vYearMonth)])),
From (ZOE_MP01/ZOE_MP01_Q005_OS));

Store Data into C:\$(vYearMonth).qvd; // change your QVD path

DROP Table Data;

NEXT

DROP Table Months;

ENDSUB

CALL MonthlyLoad (201703,202006)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Oct 2020 09:08:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748744#M57557</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-01T09:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data for last 3 years from SAP in Qlikview using Loops</title>
      <link>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748747#M57559</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;for your response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Call MonthlyLoad (201703,202006) is static&lt;/P&gt;&lt;P&gt;When the data will come for 202007, 202008, we will have to Change it manually ?. Can we make it dynamic ?&lt;/P&gt;&lt;P&gt;Please help me to understand&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 09:29:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748747#M57559</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2020-10-01T09:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data for last 3 years from SAP in Qlikview using Loops</title>
      <link>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748756#M57561</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/103918"&gt;@Aspiring_Developer&lt;/a&gt;&amp;nbsp; we can do that but those values should be stored somewhere so that qlik can pickup from there. It could be in text file or table&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 09:47:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748756#M57561</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-01T09:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data for last 3 years from SAP in Qlikview using Loops</title>
      <link>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748758#M57562</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried one approach for dynamic value but got stuck, could you please help :-&lt;/P&gt;&lt;P&gt;for year = year(today()-3) to year(today()) (Will take year 2017 to 2020)&lt;/P&gt;&lt;P&gt;for period = 1 to 12&lt;/P&gt;&lt;P&gt;I am trying to append year and period in order to create format like 201701, 201702, 201703...202006&lt;/P&gt;&lt;P&gt;But not able to find out how ?&lt;/P&gt;&lt;P&gt;If i manage to create such structure , i can store it in a variable and pass the same in query.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Variables (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[!V000004] (I = [0CALMONTH].[$()])),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;From (ZOE_MP01/ZOE_MP01_Q005_OS));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;next year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;next period&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Could you please help&amp;nbsp; pleasee&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 09:58:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748758#M57562</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2020-10-01T09:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data for last 3 years from SAP in Qlikview using Loops</title>
      <link>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748763#M57563</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/103918"&gt;@Aspiring_Developer&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let vMin = addyears(yearstart(Today()),-3);
let vMax = monthstart(Today());

Months:
LOAD date(AddMonths('$(vMin)',IterNo()-1),'YYYYMM') as Months
AutoGenerate 1
while AddMonths('$(vMin)',IterNo()-1)&amp;lt;= '$(vMax)';

for i=1 to FieldValueCount('Months')

let vYearMonth = FieldValue('Months',$(i));

Data:
Select ...

Variables (
[!V000004] (I = [0CALMONTH].[$(vYearMonth)])),
From (ZOE_MP01/ZOE_MP01_Q005_OS));

Store Data into C:\$(vYearMonth).qvd; // change QVD path here

DROP Table Data;

NEXT

DROP Table Months;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Oct 2020 10:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extracting-data-for-last-3-years-from-SAP-in-Qlikview-using/m-p/1748763#M57563</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-01T10:29:12Z</dc:date>
    </item>
  </channel>
</rss>

