<?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: Transformar IF en SetAnalysis (sumar semana anterior) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319620#M117796</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;/P&gt;&lt;P&gt;if I understood you correctly (my spanish is pretty poor), try this as expression&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Fecha={"=year(Fecha)=$(vAñoSemanaAnt)"},Semana={'$(vSemanaAnt)'}&amp;gt;} Cantidad)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and see attached app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 30 Jul 2011 22:52:30 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-07-30T22:52:30Z</dc:date>
    <item>
      <title>Transformar IF en SetAnalysis (sumar semana anterior)</title>
      <link>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319619#M117795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Necesito saber si es posible pasar a SetAnalysis la siguiente sentencia: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(year(Fecha)=$(vAñoSemanaAnt),if(Semana=$(vSemanaAnt),sum(Cantidad),0))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adjunto el documento con el que obtengo las sumas de las cantidades de la semana anterior a la actual (también tiene la opción de indicar más de una semana atrás).&lt;/P&gt;&lt;P&gt;Usando IF me funciona pero desearía usar SetAnalysis porque el documento es un ejemplo y creo que cuando el volumen de datos sea mayor el IF podría ser lento.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Saludos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2011 21:11:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319619#M117795</guid>
      <dc:creator />
      <dc:date>2011-07-30T21:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transformar IF en SetAnalysis (sumar semana anterior)</title>
      <link>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319620#M117796</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;/P&gt;&lt;P&gt;if I understood you correctly (my spanish is pretty poor), try this as expression&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Fecha={"=year(Fecha)=$(vAñoSemanaAnt)"},Semana={'$(vSemanaAnt)'}&amp;gt;} Cantidad)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and see attached app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2011 22:52:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319620#M117796</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-30T22:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Transformar IF en SetAnalysis (sumar semana anterior)</title>
      <link>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319621#M117797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Stefan, &lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;your spanish&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is probably&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;better than&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;my english &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;I only have a bit problem with the variable vSemanaAnt. I mean, when i want to set the variable vSemanasAtras to a number (example 30 or bigger) then, vSemanaAnt is 0 or &amp;lt;0 and fails, so i need to control when it change of year. Do you know how to do it?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;thefourth&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2011 08:33:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319621#M117797</guid>
      <dc:creator />
      <dc:date>2011-07-31T08:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transformar IF en SetAnalysis (sumar semana anterior)</title>
      <link>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319622#M117798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thefourth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I learned some spanish some years ago, but compared to your english... I would prefer to stay with english &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/silly.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I understood your application correctly, you want to distinguish between the calendar year a date is in (say 2/1/2011 is in CY 2011)&lt;/P&gt;&lt;P&gt;and the year where the week of the date belongs to (e.g. for 2/1/2011 its still week 52/2010), right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in my example, if vSemanaAtras=30, vSemanaAnt should be 52 and vAnoSemanaAnt should be 2010, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the year of the calendar week, you don't need complicated expressions to calculate, there is weekyear() function in QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see my attached modifications of variables and set expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2011 11:27:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319622#M117798</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-31T11:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Transformar IF en SetAnalysis (sumar semana anterior)</title>
      <link>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319623#M117799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;Really excellent Stefan! You understood everything &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;in the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;right way. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt; &lt;/SPAN&gt;&lt;SPAN class="hps"&gt;&lt;/SPAN&gt;&lt;SPAN class="hps"&gt;I did not know&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the weekyear() &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;function.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;Thank you very much,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;thefourth&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2011 19:47:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transformar-IF-en-SetAnalysis-sumar-semana-anterior/m-p/319623#M117799</guid>
      <dc:creator />
      <dc:date>2011-07-31T19:47:47Z</dc:date>
    </item>
  </channel>
</rss>

