<?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: How to retrieve data from 4 last week script loop ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125461#M753049</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;week(Today())-IterNo() as Week&lt;/P&gt;&lt;P&gt;AutoGenerate(5)&lt;/P&gt;&lt;P&gt;While IterNo()&amp;lt;5 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i=0 to 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vWeek=peek('Week',$(i),'A');&lt;/P&gt;&lt;P&gt;B:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Your statement&lt;/P&gt;&lt;P&gt;where Week(Date) = $(vWeek);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;store B into QVD_$(vWeek).qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Oct 2018 07:47:30 GMT</pubDate>
    <dc:creator>jyothish8807</dc:creator>
    <dc:date>2018-10-23T07:47:30Z</dc:date>
    <item>
      <title>How to retrieve data from 4 last week script loop ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125456#M753042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&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;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;Here is what a collegue did, but it doesn't work.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;PLease help !!!!&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;set jour_calcul = today();&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;let ann = year ($(jour_calcul) - 45);&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;let ann_prec = $(ann) - 1;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;let mois = month ($(jour_calcul) - 45);&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;// Chargt des fichiers&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;// -------------------&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;For j = 1 to 2&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;if j = 1 then&lt;/P&gt;&lt;PRE style="margin: 0 0 1em; padding: 5px; font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; background-color: #eff0f1; color: #242729;"&gt;&lt;CODE style="font-weight: inherit; font-style: inherit; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt; let sem_ref = $(ann_prec) &amp;amp; '2'; let sem_enr = $(ann) &amp;amp; '1'; let deb =$(#mois); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;else&lt;/P&gt;&lt;PRE style="margin: 0 0 1em; padding: 5px; font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; background-color: #eff0f1; color: #242729;"&gt;&lt;CODE style="font-weight: inherit; font-style: inherit; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt; let sem_ref = $(ann) &amp;amp; '1'; let sem_enr = $(ann) &amp;amp; '2'; if $(#mois) &amp;lt; 7 then &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;let deb = 1;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;else&lt;/P&gt;&lt;PRE style="margin: 0 0 1em; padding: 5px; font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; background-color: #eff0f1; color: #242729;"&gt;&lt;CODE style="font-weight: inherit; font-style: inherit; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt; let deb = $(#mois) - 6; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;end if&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;end if&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;For i = $(#deb) to 6&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;set filename = SEGM_$(sem_enr)_$(i).qvd;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;segm:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;SQL request (just an example)&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;store segm into $(filename) (qvd);&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;drop table segm;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;next i&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: #f2f2f2; color: #242729;"&gt;next j&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125456#M753042</guid>
      <dc:creator>NiceC</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve data from 4 last week script loop ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125457#M753044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi cedric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can simply try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if have a field called 'Date' in your database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vLast4Week= Week(Today())-4;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A:&lt;/P&gt;&lt;P&gt;Laod&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;from &amp;lt;&amp;gt;&lt;/P&gt;&lt;P&gt;where Week(Date)&amp;gt; $(&lt;SPAN style="font-size: 13.3333px;"&gt;vLast4Week);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Store A into ABC.qvd;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Br,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;KC&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 05:39:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125457#M753044</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2018-10-23T05:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve data from 4 last week script loop ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125458#M753046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have any Week Calculation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 06:45:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125458#M753046</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-10-23T06:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve data from 4 last week script loop ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125459#M753047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jyothish, thanks for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i want to store data per week per file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually we are on week 43.&lt;/P&gt;&lt;P&gt;i want to have data for :&lt;/P&gt;&lt;P&gt;week 42 stored in abc_42.qvd&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;week 41 stored in abc_41.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;week 40 stored in abc_40.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;week 39 stored in abc_39.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;here is the query used : &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SELECT e.cli_id&lt;/P&gt;&lt;P&gt;, seg_rfm, 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;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 07:17:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125459#M753047</guid>
      <dc:creator>NiceC</dc:creator>
      <dc:date>2018-10-23T07:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve data from 4 last week script loop ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125460#M753048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i only have a date in my database.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;i want to store data per week per file.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Actually we are on week 43.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;i want to have data for :&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;week 42 stored in abc_42.qvd&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&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: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&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: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&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 style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;here is the query used :&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SELECT e.cli_id&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, seg_rfm, seg_semestres&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, 20182 semestre&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, decode(reseau,'W','Web','Mag') Canal&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, adr_pays pays&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, Sum(clients.conv.get_montant(dev_iso_tenue,'EUR',dat_tic,'$$',ca_ttc_dev)) CA_TTC_EUR&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, Sum(nb_art) NB_ART&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, Sum(Decode(Sign(ca_ttc_dev),1,1,0)) NB_CDE, sysdate dat_maj&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM clients.tic_entete e&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;join clients.cli_fiche f on f.cli_id=e.cli_id&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;join mag_magasins m on m.magasin = e.magasin&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;join seg_rfm s on s.cli_id = f.cli_id and s.semestre = 20181&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WHERE dat_vte between clients.seg.prem_jour(20182) AND promod.ansem_date(201831,7)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;GROUP BY e.cli_id&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, seg_rfm, seg_semestres&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, decode(reseau,'W','Web','Mag')&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, adr_pays&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 07:24:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125460#M753048</guid>
      <dc:creator>NiceC</dc:creator>
      <dc:date>2018-10-23T07:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve data from 4 last week script loop ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125461#M753049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;week(Today())-IterNo() as Week&lt;/P&gt;&lt;P&gt;AutoGenerate(5)&lt;/P&gt;&lt;P&gt;While IterNo()&amp;lt;5 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i=0 to 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vWeek=peek('Week',$(i),'A');&lt;/P&gt;&lt;P&gt;B:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Your statement&lt;/P&gt;&lt;P&gt;where Week(Date) = $(vWeek);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;store B into QVD_$(vWeek).qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 07:47:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125461#M753049</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2018-10-23T07:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve data from 4 last week script loop ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125462#M753050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jyothish&lt;/P&gt;&lt;P&gt;i just replaced AutoGenerate(5) by AutoGenerate(1). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 14:13:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125462#M753050</guid>
      <dc:creator>NiceC</dc:creator>
      <dc:date>2018-10-24T14:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve data from 4 last week script loop ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125463#M753051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;, Glad it helped you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2018 05:24:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-data-from-4-last-week-script-loop/m-p/125463#M753051</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2018-10-25T05:24:52Z</dc:date>
    </item>
  </channel>
</rss>

