<?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: loop data for the 4 last week in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/loop-data-for-the-4-last-week/m-p/124776#M601481</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny, i want to get the last 4 weeks data from this sql statement &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;and store them in a qvd file per week. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This query extracts data for the day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are on week 43 right now.&lt;/P&gt;&lt;P&gt;From this sql query below,&lt;/P&gt;&lt;P&gt;i want to have data for&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;week 42 stored in abc_42.qvd&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;week 41 stored in abc_41.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;week 40 stored in abc_40.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;week 39 stored in abc_39.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;SELECT e.cli_id&lt;/P&gt;&lt;P&gt;, seg_rfm&lt;/P&gt;&lt;P&gt;, seg_semestres&lt;/P&gt;&lt;P&gt;, 20182 semestre&lt;/P&gt;&lt;P&gt;, decode(reseau,'W','Web','Mag') Canal&lt;/P&gt;&lt;P&gt;, adr_pays pays&lt;/P&gt;&lt;P&gt;, Sum(clients.conv.get_montant(dev_iso_tenue,'EUR',dat_tic,'$$',ca_ttc_dev)) CA_TTC_EUR&lt;/P&gt;&lt;P&gt;, Sum(nb_art) NB_ART&lt;/P&gt;&lt;P&gt;, Sum(Decode(Sign(ca_ttc_dev),1,1,0)) NB_CDE, sysdate dat_maj&lt;/P&gt;&lt;P&gt;FROM clients.tic_entete e&lt;/P&gt;&lt;P&gt;join clients.cli_fiche f on f.cli_id=e.cli_id&lt;/P&gt;&lt;P&gt;join mag_magasins m on m.magasin = e.magasin&lt;/P&gt;&lt;P&gt;join seg_rfm s on s.cli_id = f.cli_id and s.semestre = 20181&lt;/P&gt;&lt;P&gt;WHERE dat_vte between clients.seg.prem_jour(20182) AND promod.ansem_date(201831,7)&lt;/P&gt;&lt;P&gt;GROUP BY e.cli_id&lt;/P&gt;&lt;P&gt;, seg_rfm, seg_semestres&lt;/P&gt;&lt;P&gt;, decode(reseau,'W','Web','Mag')&lt;/P&gt;&lt;P&gt;, adr_pays&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is a result of this sql script.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="216518" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/216518_Capture.PNG" style="height: 435px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Oct 2018 07:13:22 GMT</pubDate>
    <dc:creator>NiceC</dc:creator>
    <dc:date>2018-10-23T07:13:22Z</dc:date>
    <item>
      <title>loop data for the 4 last week</title>
      <link>https://community.qlik.com/t5/QlikView/loop-data-for-the-4-last-week/m-p/124774#M601479</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;SPAN style="font-size: 10pt;"&gt;I would like to make a loop that will retrieve the data of the last 4 weeks via a sql request and store them in a qvd file per week. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Here is what a collegue did, but it doesn't work. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;PLease help !!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;set jour_calcul = today();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let ann = year ($(jour_calcul) - 45);&lt;/P&gt;&lt;P&gt;let ann_prec = $(ann) - 1;&lt;/P&gt;&lt;P&gt;let mois = month ($(jour_calcul) - 45);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Chargt des fichiers&lt;/P&gt;&lt;P&gt;// -------------------&lt;/P&gt;&lt;P&gt;For j = 1 to 2&lt;/P&gt;&lt;P&gt;if j = 1 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let sem_ref = $(ann_prec) &amp;amp; '2';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let sem_enr = $(ann) &amp;amp; '1';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let deb =$(#mois);&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let sem_ref = $(ann) &amp;amp; '1';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let sem_enr = $(ann) &amp;amp; '2';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if $(#mois) &amp;lt; 7 then&lt;/P&gt;&lt;P&gt;let deb = 1;&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let deb = $(#mois) - 6;&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = $(#deb) to 6&lt;/P&gt;&lt;P&gt;set filename = SEGM_$(sem_enr)_$(i).qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;segm:&lt;/P&gt;&lt;P&gt;SQL request (just an example)&lt;/P&gt;&lt;P&gt;store segm into $(filename) (qvd);&lt;/P&gt;&lt;P&gt;drop table segm;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next i&lt;/P&gt;&lt;P&gt;next j&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2018 09:33:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/loop-data-for-the-4-last-week/m-p/124774#M601479</guid>
      <dc:creator>NiceC</dc:creator>
      <dc:date>2018-10-22T09:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: loop data for the 4 last week</title>
      <link>https://community.qlik.com/t5/QlikView/loop-data-for-the-4-last-week/m-p/124775#M601480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi would you be able to share some data with which you are trying to run this script? It might help to know what you are getting and what are you expecting to get based on the data shared&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 00:26:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/loop-data-for-the-4-last-week/m-p/124775#M601480</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-10-23T00:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: loop data for the 4 last week</title>
      <link>https://community.qlik.com/t5/QlikView/loop-data-for-the-4-last-week/m-p/124776#M601481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny, i want to get the last 4 weeks data from this sql statement &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;and store them in a qvd file per week. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This query extracts data for the day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are on week 43 right now.&lt;/P&gt;&lt;P&gt;From this sql query below,&lt;/P&gt;&lt;P&gt;i want to have data for&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;week 42 stored in abc_42.qvd&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;week 41 stored in abc_41.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;week 40 stored in abc_40.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;week 39 stored in abc_39.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;SELECT e.cli_id&lt;/P&gt;&lt;P&gt;, seg_rfm&lt;/P&gt;&lt;P&gt;, seg_semestres&lt;/P&gt;&lt;P&gt;, 20182 semestre&lt;/P&gt;&lt;P&gt;, decode(reseau,'W','Web','Mag') Canal&lt;/P&gt;&lt;P&gt;, adr_pays pays&lt;/P&gt;&lt;P&gt;, Sum(clients.conv.get_montant(dev_iso_tenue,'EUR',dat_tic,'$$',ca_ttc_dev)) CA_TTC_EUR&lt;/P&gt;&lt;P&gt;, Sum(nb_art) NB_ART&lt;/P&gt;&lt;P&gt;, Sum(Decode(Sign(ca_ttc_dev),1,1,0)) NB_CDE, sysdate dat_maj&lt;/P&gt;&lt;P&gt;FROM clients.tic_entete e&lt;/P&gt;&lt;P&gt;join clients.cli_fiche f on f.cli_id=e.cli_id&lt;/P&gt;&lt;P&gt;join mag_magasins m on m.magasin = e.magasin&lt;/P&gt;&lt;P&gt;join seg_rfm s on s.cli_id = f.cli_id and s.semestre = 20181&lt;/P&gt;&lt;P&gt;WHERE dat_vte between clients.seg.prem_jour(20182) AND promod.ansem_date(201831,7)&lt;/P&gt;&lt;P&gt;GROUP BY e.cli_id&lt;/P&gt;&lt;P&gt;, seg_rfm, seg_semestres&lt;/P&gt;&lt;P&gt;, decode(reseau,'W','Web','Mag')&lt;/P&gt;&lt;P&gt;, adr_pays&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is a result of this sql script.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="216518" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/216518_Capture.PNG" style="height: 435px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 07:13:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/loop-data-for-the-4-last-week/m-p/124776#M601481</guid>
      <dc:creator>NiceC</dc:creator>
      <dc:date>2018-10-23T07:13:22Z</dc:date>
    </item>
  </channel>
</rss>

